Andrea Arcangeli wrote: > If there's anybody willing to suggest the files to hook into (the > location where the interpreter allocates all anonymous memory) and how > to invoke gc.collect() from C, that would help. thanks!
It all happens in Modules/gcmodule.c:_PyObject_GC_Malloc. There are per-generation counters; _PyObject_GC_Malloc increments the generation 0 counter, and PyObject_GC_Del decreases it. The counters of the higher generations are incremented when a lower collection occurs. 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. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com