Date: Tue, 23 Apr 2002 03:26:58 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Andrew Gould <andrewgould@yahoo.com> Cc: FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG> Subject: Re: Python on FreeBSD -- problems? Message-ID: <20020423002658.GA3341@hades.hell.gr> In-Reply-To: <20020422234207.12257.qmail@web13403.mail.yahoo.com> References: <20020422233626.GB2316@hades.hell.gr> <20020422234207.12257.qmail@web13403.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020423002658.GA3341>