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 corona10, erlendaasland, kumaraditya, miss-islington, petr.viktorin, phsilva, shihai1991, vstinner
Date 2022-01-23.02:22:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642904568.35.0.341857552463.issue46417@roundup.psfhosted.org>
In-reply-to
Content
> See also bpo-46476: Not all memory allocated by _Py_Quicken() is released at Python exit.

If you apply my workaround for bpo-46476:
https://bugs.python.org/issue46476#msg411321

Python no longer leaks any memory block at exit for the simplest command!

$ ./python -I -X showrefcount -c pass
[-5 refs, 0 blocks]

Moreover, I modified deepfreeze to only freeze importlib._bootstrap and importlib._bootstrap_external. It confirms that bpo-46449 is causing the negative reference count, because with these additional local changes I get a positive _Py_RefTotal:

$ ./python -I -X showrefcount -c pass
[6 refs, 0 blocks]
History
Date User Action Args
2022-01-23 02:22:48vstinnersetrecipients: + vstinner, phsilva, petr.viktorin, corona10, miss-islington, shihai1991, erlendaasland, kumaraditya
2022-01-23 02:22:48vstinnersetmessageid: <1642904568.35.0.341857552463.issue46417@roundup.psfhosted.org>
2022-01-23 02:22:48vstinnerlinkissue46417 messages
2022-01-23 02:22:48vstinnercreate