Some thoughts on garbage collection
Frank Millman
frank at chagford.com
Mon Jan 23 02:45:25 EST 2006
Paul Rubin wrote:
> "Frank Millman" <frank at chagford.com> writes:
> > Is this a sensible approach, or are there easier ways to achieve this?
>
> In general you're supposed to just let gc do its thing. Doing your
> own storage management defeats the purpose of gc.
In principle I agree. My concern was that I might have inadvertently
done something wrong (e.g. left a reference dangling) which would
prevent gc from removing all objects which I wanted to be removed.
> At most I'd say
> check for leaks by running some native extension to scan all the
> in-memory objects to see if anything didn't get gc'd.
If I knew what you meant, I would agree with you :-)
As all I really know is Python, the method I used was the best way I
could think of to accomplish what I wanted.
Frank
More information about the Python-list
mailing list