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.

Title: Garbage collector release method
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.2
Status: closed Resolution: duplicate
Dependencies: Superseder: Py_Finalize() doesn't clear all Python objects at exit
View: 1635741
Assigned To: Nosy List: Satshabad.Khalsa, gardster, loewis, vstinner
Priority: normal Keywords:

Created on 2009-08-20 12:38 by gardster, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
patch Satshabad.Khalsa, 2013-03-18 22:57
Messages (5)
msg91772 - (view) Author: Lev (gardster) Date: 2009-08-20 12:38
WinCRT debug detects several memory leaks after calling py_Initialize
(); py_Finalize(); functions. Most of them are garbage collector 
visible python's objects. I suggest to create "release" method in 
garbage collector which will distruct all objects in GC list without 
reference count checking, and call this method at the end of py_Finalize
() function. I think, that it will help to avoid memory leaks after 
calling py_Finalize() function.
msg91788 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-08-20 22:00
Can you propose a patch?
msg91802 - (view) Author: Lev (gardster) Date: 2009-08-21 06:15
I,m trying to develop this patch now, but I'm facing the challenge 
(wrong ref_count or list corruption in dict objects). If I can solve 
it, I publish patch here.
msg184545 - (view) Author: Satshabad Khalsa (Satshabad.Khalsa) Date: 2013-03-18 22:57
This is a test that is supposed to run c that creates two objects, cross references them with embedded python DECREF's the objects. Then it asserts that after Py_fini is called, they have no more references because the gc should have collected them. 

Unfortunately the test is not failing for the right reasons and I can't figure out why.
msg355188 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-23 00:12
That's basically a duplicate of bpo-1635741.
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 50990
2019-10-23 00:12:45vstinnersetstatus: open -> closed

superseder: Py_Finalize() doesn't clear all Python objects at exit

nosy: + vstinner
messages: + msg355188
resolution: duplicate
stage: test needed -> resolved
2013-03-18 22:57:26Satshabad.Khalsasetfiles: + patch
nosy: + Satshabad.Khalsa
messages: + msg184545

2010-07-10 06:57:46terry.reedysetstage: test needed
versions: + Python 3.2, - Python 2.6
2009-08-21 06:15:09gardstersetmessages: + msg91802
2009-08-20 22:00:21loewissetnosy: + loewis
messages: + msg91788
2009-08-20 12:38:30gardstercreate