What does gc.get_objects() return?

Jurko Gospodnetić jurko.gospodnetic at pke.hr
Mon Mar 17 18:53:24 CET 2014


   Hi.

On 17.3.2014. 18:18, Antoine Pitrou wrote:
> All in all, though, gc.get_objects() is an expensive function call (it
> will walk the entire graph of objects tracked by the GC, which can be very
> large in non-trivial applications), so it's really only useful for
> debugging (and, I'd add, for low-level debugging). In most situations,
> gc.get_objects() is certainly the wrong tool to use.

   I agree, and for the record, we were using it for debugging when I 
started this thread - trying to track down a memory leak. :-)

   gc.get_objects() turned out to be of great help with in resolving the 
issue - in the end we tracked it down to a typical reference counting 
problem in a Python extension DLL. *doh*

   Best regards,
     Jurko Gospodnetić




More information about the Python-list mailing list