[issue6695] PyXXX_ClearFreeList for dict, set, and list

Raymond Hettinger report at bugs.python.org
Sun Aug 16 00:06:17 CEST 2009


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

> The reason is that users expect gc.collect() to make 
> its best to diminish memory use.

I thought GC was expected to eliminate reference cycles.
Perhaps there ought to be a separate API, such as 
sys.clear_freelists(), to eliminate other memory use when 
needed.  Putting this in GC seems like feature creep and
has negative performance implications (long running programs
will likely find an immediate need to reallocate the freed
members).


> Allocated items in the free list may keep a pymalloc arena occupied.
> * Clearing the free lists may give back memory to the OS earlier.

These are both good reasons to expose the functionality somewhere.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6695>
_______________________________________


More information about the Python-bugs-list mailing list