From owner-freebsd-questions Mon Apr 22 17:27:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 3978D37B41A for ; Mon, 22 Apr 2002 17:27:10 -0700 (PDT) Received: from hades.hell.gr (patr530-a184.otenet.gr [212.205.215.184]) by mailsrv.otenet.gr (8.12.2/8.12.2) with ESMTP id g3N0R0lv015601; Tue, 23 Apr 2002 03:27:01 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.2/8.12.2) with ESMTP id g3N0R08i003391; Tue, 23 Apr 2002 03:27:00 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.2/8.12.2/Submit) id g3N0Qxgd003390; Tue, 23 Apr 2002 03:26:59 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 23 Apr 2002 03:26:58 +0300 From: Giorgos Keramidas To: Andrew Gould Cc: FreeBSD Mailing List Subject: Re: Python on FreeBSD -- problems? Message-ID: <20020423002658.GA3341@hades.hell.gr> References: <20020422233626.GB2316@hades.hell.gr> <20020422234207.12257.qmail@web13403.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020422234207.12257.qmail@web13403.mail.yahoo.com> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-04-22 16:42, Andrew Gould wrote: > The code is attached in the text file thcic.py. The > traceback mentions a memory error at line 37. My guess is you're running out of memory or hitting some memory allocation limit because datasource.readlines() tries to fetch all the data from the datasource and store it in memory near line 37. 34 #Read each line of the data source and insert the fields and tab delimiters 35 #into the outfile. 36 37 for recordn in datasource.readlines(): ... 146 datasource.close() 147 newfile.close() You're probably hitting the user limits imposed by FreeBSD on you, even though the system still has free memory. Try rewriting this loop to read one line at a time, and see if it solves the problem. - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message