This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ncoghlan, neologix, vstinner
Date 2014-06-12.12:48:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402577320.7.0.278263630534.issue19816@psf.upfronthosting.co.za>
In-reply-to
Content
I tried different options to show the memory leaks found by tracemalloc, but I'm not satisfied by any option. I get a lot of noise, the output is almost useless. Randomly, between 1 and 1000 KB are allocated or released in random files: in unittest or linecache modules for example.

It looks like the major issue is that the unittest leaks memory. For example, there are still 4 TestCase instances alive after the execution of test_sys. But later, these instances are deleted.

It looks like it creates reference leaks and so memory is only released late. Calling gc.collect() doesn't help. I remember that I already saw something strange with the _Outcome class used in unittest.TestCase.run(). See the issue #19880 (changeset 09658ea0b93d).

The asyncio module has a similar issue: it stores an exception which indirectly contains a reference cycle in the Exception.__traceback__ attribute.
http://bugs.python.org/issue17911
https://code.google.com/p/tulip/issues/detail?id=155
History
Date User Action Args
2014-06-12 12:48:41vstinnersetrecipients: + vstinner, ncoghlan, neologix
2014-06-12 12:48:40vstinnersetmessageid: <1402577320.7.0.278263630534.issue19816@psf.upfronthosting.co.za>
2014-06-12 12:48:40vstinnerlinkissue19816 messages
2014-06-12 12:48:38vstinnercreate