Creating Long Lists

Peter Otten __peter__ at web.de
Tue Feb 22 05:06:24 EST 2011


Kelson Zawack wrote:

> The answer it turns out is the garbage collector.  When I disable the
> garbage collector before the loop that loads the data into the list
> and then enable it after the loop the program runs without issue.
> This raises a question though, can the logic of the garbage collector
> be changed so that it is not triggered in instances like this were you
> really do want to put lots and lots of stuff in memory.  Turning on
> and off the garbage collector is not a big deal, but it would
> obviously be nicer not to have to.

What Python version are you using? The garbage collection heuristic has been 
tweaked in 2.7, see

http://svn.python.org/view/python/trunk/Modules/gcmodule.c?r1=67832&r2=68462



More information about the Python-list mailing list