Message220343
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 |
|
Date |
User |
Action |
Args |
2014-06-12 12:48:41 | vstinner | set | recipients:
+ vstinner, ncoghlan, neologix |
2014-06-12 12:48:40 | vstinner | set | messageid: <1402577320.7.0.278263630534.issue19816@psf.upfronthosting.co.za> |
2014-06-12 12:48:40 | vstinner | link | issue19816 messages |
2014-06-12 12:48:38 | vstinner | create | |
|