Question about garbage collection

Barry barry at barrys-emacs.org
Tue Jan 16 17:37:05 EST 2024



> On 16 Jan 2024, at 12:10, Frank Millman via Python-list <python-list at python.org> wrote:
> 
> My problem is that my app is quite complex, and it is easy to leave a reference dangling somewhere which prevents an object from being gc'd.

What I do to track these problems down is use gc.get_objects() then summerize the number of each type. Part 2 is to print the delta after an interval of a 2nd summary.
Leaks of objects show up as the count of a type increasing every time you sample.


Barry




More information about the Python-list mailing list