gc.garbage

"Martin v. Löwis" martin at v.loewis.de
Thu Aug 30 05:50:52 EDT 2007


> gc.set_debug(gc.DEBUG_LEAK)
> print gc.garbage
> 
> --output:--
> []
> gc: uncollectable <Dog 0x56e10>
> gc: uncollectable <Cat 0x56e30>
> gc: uncollectable <dict 0x58270>
> gc: uncollectable <dict 0x43e40>

gc.garbage is filled only after these messages
are printed, not before. You need to add an explicit
call to gc.collect() if you want to see what
uncollectable garbage you have.

Regards,
Martin



More information about the Python-list mailing list