[Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2))

Neil Schemenauer nas at arctrix.com
Thu Dec 29 03:14:32 CET 2005


Martin v. Löwis <martin at v.loewis.de> wrote:
> One challenge is that PyObject_GC_Del doesn't know how large the memory
> block is that is being released. So it is difficult to find out how
> much memory is being released in the collection.

Another idea would be to add accounting to the PyMem_* interfaces.
It could be that most memory is used by objects that are not tracked
by the GC (e.g. strings).  I guess you still have the same problem
in that PyMem_Free may not know how large the memory block is.

  Neil



More information about the Python-Dev mailing list