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 emptysquare, eric.snow, grahamd, ncoghlan, phsilva, pitrou, vstinner
Date 2019-12-09.10:14:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This issue is partially fixed in the master branch. Extract of the finalize_interp_clear() function, called by Py_EndInterpreter():

    /* Clear interpreter state and all thread states */

    /* Trigger a GC collection on subinterpreters*/
    if (!is_main_interp) {

gc.collect() is now called.

It's only "partially" fixed because I would prefer to trigger a GC collection before or during PyInterpreterState_Clear(). IMHO trigger it after PyInterpreterState_Clear() creates a risk of crash in finalizers written in C which don't handle well before called very late during Python finalization. After PyInterpreterState_Clear(), Python is basically unusable. All modules are cleared.
Date User Action Args
2019-12-09 10:14:07vstinnersetrecipients: + vstinner, ncoghlan, pitrou, phsilva, grahamd, eric.snow, emptysquare
2019-12-09 10:14:07vstinnersetmessageid: <>
2019-12-09 10:14:07vstinnerlinkissue24554 messages
2019-12-09 10:14:07vstinnercreate