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 pitrou, vstinner
Date 2014-07-10.20:23:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> When using some filters and comparing snapshots, fnmatch will appear in the statistic diffs, e.g.:

During the design of the tracemalloc module (PEP 454), it was decided to not filter traces in the C module, but filter traces on a snapshot object. The reason is to keep the C module simple. To debug, you can analyze snapshots on a fast machine.

Can you try to filter traces?

snapshot = snapshot.filter_traces(Filter(False, tracemalloc.__file__))

In you case, the top frame is in the fnmatch module, so you probably need to trace more than one thread (ex: tracemalloc.start(10)) and apply the filter on all frames, not only on the top frame:

snapshot = snapshot.filter_traces(Filter(False, tracemalloc.__file__, all_frames=True))

You can also ignore fnmatch & sre_compile modules (blacklist, exclusive filters), or only keep traces of the directory /home/antoine/llvmpy/llvm/ (whitelist, an inclusive filter).

> Perhaps it would be nice to manually cache the compiled re pattern, instead of going through fnmatch's lru_cache thing which seems to make reports less robust.

Ah, interesting point. Would you be interested to work on that?

I tried to use tracemalloc to detect memory leaks in test.regrtest, but it's very difficult to get a reliable output. See the issue #19816.
Date User Action Args
2014-07-10 20:23:31vstinnersetrecipients: + vstinner, pitrou
2014-07-10 20:23:31vstinnersetmessageid: <>
2014-07-10 20:23:31vstinnerlinkissue21952 messages
2014-07-10 20:23:31vstinnercreate