This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients gvanrossum, matthiastroffaes, pitrou, rhettinger, skip.montanaro
Date 2009-08-15.17:35:02
SpamBayes Score 5.379855e-07
Marked as misclassified No
Message-id <1250357728.5.0.828373931275.issue6695@psf.upfronthosting.co.za>
In-reply-to
Content
The reason is that users expect gc.collect() to make its best to
diminish memory use. Clearing free lists can allow deallocting some
arenas which otherwise would still contain some used memory blocks. As
the comment says:

/* Clear all free lists
 * All free lists are cleared during the collection of the highest
generation.
 * Allocated items in the free list may keep a pymalloc arena occupied.
 * Clearing the free lists may give back memory to the OS earlier.
 */

Full collections (collections of the oldest generation) are rather rare,
so the performance impact is probably minimal, and it helps reduce
memory fragmentation from time to time (which can produce significant
effect as shown in Matthias' example).
History
Date User Action Args
2009-08-15 17:35:28pitrousetrecipients: + pitrou, gvanrossum, skip.montanaro, rhettinger, matthiastroffaes
2009-08-15 17:35:28pitrousetmessageid: <1250357728.5.0.828373931275.issue6695@psf.upfronthosting.co.za>
2009-08-15 17:35:02pitroulinkissue6695 messages
2009-08-15 17:35:02pitroucreate