Use __del__ methods to improve gc?

Tim Peters tim.one at comcast.net
Sun Jun 15 18:54:57 EDT 2003


[Edward K. Ream]
> BTW, I'm chuckling a little less now.  Executing:
>
> print len(gc.garbage), len(gc.get_objects())
>
> periodically shows that my app is steadily eating memory.
> len(gc.garbage) remains zero while len(gc.get_objects()) steadily
> increases.  And I thought I was recycling all bindings :-(

Didn't you say before that, because of unlimited undo, you expected
unbounded growth?

> You wouldn't know of something similar to timeit for storage
> allocation, would you?

Well, gc.get_objects() is a list of all container objects in existence.
Start by looking at it, to see whether unexpected stuff is in it.  If
something is in gc.objects() after doing gc.collect(), it's because it's
still reachable.






More information about the Python-list mailing list