From owner-freebsd-questions Mon Apr 22 23:21:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from web13408.mail.yahoo.com (web13408.mail.yahoo.com [216.136.175.66]) by hub.freebsd.org (Postfix) with SMTP id 3E84737B41E for ; Mon, 22 Apr 2002 23:19:17 -0700 (PDT) Message-ID: <20020423061917.49507.qmail@web13408.mail.yahoo.com> Received: from [67.202.28.230] by web13408.mail.yahoo.com via HTTP; Mon, 22 Apr 2002 23:19:17 PDT Date: Mon, 22 Apr 2002 23:19:17 -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 It worked! Thanks again. 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