STINNER Victor <vstin...@redhat.com> added the comment:
A little bit of history. I opened a bug 2 years ago but I closed it (lack of interest): https://github.com/vstinner/pytracemalloc/issues/2 I rewrote tracemalloc between version 0.9 and 1.0. In tracemalloc 0.9, there was an API to track free lists. Here is the code to handle "alloc" and "free" of an object inside a freelist: https://github.com/vstinner/pytracemalloc/blob/a2b2616fc73cd5ce0ea45d1b68a490e0fc52ccc8/_tracemalloc.c#L291-L337 My PR 10063 has a more correct and efficient implementation: * It keeps the trace alive when the object moves into the free list to report the real memory usage of Python: the free lists consumes memory * It writes directly into the hash table entry rather than remove/add frequently the trace, it should be more efficient ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35053> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com