Message411326
| Author |
vstinner |
| Recipients |
Mark.Shannon, eric.snow, gvanrossum, vstinner |
| Date |
2022年01月23日.01:15:17 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1642900517.59.0.23445233518.issue46476@roundup.psfhosted.org> |
| In-reply-to |
| Content |
Maybe there should be a way to traverse all immortal code objects at Python exit and clear their PyCodeObject.co_quickened member (and maybe some other members).
Would it be possible to enhance deepfreeze be produce a list of all (immortal) code objects?
I did something similar for static types with _PyStaticType_Dealloc() in bpo-46417, but it's easy since the list of static type is known in advance and it's short (100 to 200 types).
--
I'm working on fixing the very old bug bpo-1635741: Python must release all memory that it called in Py_Finalize(). It matters when Python is embedded in an application. It makes sense to call Py_Initialize()/Py_Finalize() multiple times in such use case. Python should not leak any memory.
With my PR 30815 fix + my msg411321 workaround, "./python -I -X showrefcount -c pass" now says that Python leaks exactly *zero* memory block: so bpo-1635741 is basically fixed, for the simplest Python command ("pass"). Obviously, I expect that more work is needed for more complex workload, since there are other static types which are still not cleared at Python exit, and more C extension modules which are not ported to the multi-phase initialization API (PEP 489).
Valgrind is just one way to see the issue. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2022年01月23日 01:15:17 | vstinner | set | recipients:
+ vstinner, gvanrossum, Mark.Shannon, eric.snow |
| 2022年01月23日 01:15:17 | vstinner | set | messageid: <1642900517.59.0.23445233518.issue46476@roundup.psfhosted.org> |
| 2022年01月23日 01:15:17 | vstinner | link | issue46476 messages |
| 2022年01月23日 01:15:17 | vstinner | create |
|