int/float/long free lists (was Re: magic memory leak, Python or Windows problem?)

Aahz aahz at pythoncraft.com
Fri May 2 15:47:05 EDT 2003


In article <mailman.1051892646.8750.python-list at python.org>,
Tim Peters  <tim.one at comcast.net> wrote:
>
>Believe it or not, it's sitting in the 2 million integer objects created by
>range(2000000).  Each int object consumes 12 bytes on your box.  Python
>doesn't even try to return memory for int objects to the system until it
>shuts down; instead memory for int objects is saved in a dedicated
>int-object free list, for quick reuse later.  Float objects have another,
>similar dedicated free list, but you have only one float object in this
>program.

What about longs?  How does/will that affect int/long integration?  (I
see from longobject.c that we currently don't have a free list for
longs; when we convert entirely to longs, what effect will that have on
performance?)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles:  boring syntax, unsurprising semantics,
few automatic coercions, etc etc.  But that's one of the things I like
about it."  --Tim Peters on Python, 16 Sep 93




More information about the Python-list mailing list