From owner-freebsd-questions Mon Apr 22 19:38:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from web13409.mail.yahoo.com (web13409.mail.yahoo.com [216.136.172.17]) by hub.freebsd.org (Postfix) with SMTP id 0F3F237B416 for ; Mon, 22 Apr 2002 19:38:31 -0700 (PDT) Message-ID: <20020423023819.19563.qmail@web13409.mail.yahoo.com> Received: from [67.202.28.138] by web13409.mail.yahoo.com via HTTP; Mon, 22 Apr 2002 19:38:19 PDT Date: Mon, 22 Apr 2002 19:38:19 -0700 (PDT) From: Andrew Gould Subject: Re: Python on FreeBSD -- problems? To: Giorgos Keramidas Cc: FreeBSD Mailing List In-Reply-To: <20020423002658.GA3341@hades.hell.gr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Thank you. I will try this. Andrew Gould --- Giorgos Keramidas wrote: > 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 > __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message