diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-10-13 15:48:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-13 15:48:59 (GMT) |
commit | 466326dcdf038b948d94302c315be407c73e60d1 (patch) | |
tree | e19508731d6c91651ae58a85e8d3d00a09a39c99 /Misc | |
parent | e3babbd03cd2bcb3c85deabae3bc6976aa95a3c3 (diff) | |
download | cpython-466326dcdf038b948d94302c315be407c73e60d1.zip cpython-466326dcdf038b948d94302c315be407c73e60d1.tar.gz cpython-466326dcdf038b948d94302c315be407c73e60d1.tar.bz2 |
bpo-38379: Don't block collection of unreachable objects when some objects resurrect (GH-16687)
Currently if any finalizer invoked during garbage collection resurrects any object, the gc gives up and aborts the collection. Although finalizers are assured to only run once per object, this behaviour of the gc can lead to an ever-increasing memory situation if new resurrecting objects are allocated in every new gc collection.
To avoid this, recompute what objects among the unreachable set need to be resurrected and what objects can be safely collected. In this way, resurrecting objects will not block the collection of other objects in the unreachable set.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2019-10-10-01-41-02.bpo-38379._q4dhn.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-10-10-01-41-02.bpo-38379._q4dhn.rst b/Misc/NEWS.d/next/Core and Builtins/2019-10-10-01-41-02.bpo-38379._q4dhn.rst new file mode 100644 index 0000000..86f908b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-10-10-01-41-02.bpo-38379._q4dhn.rst @@ -0,0 +1,4 @@ +When the garbage collector makes a collection in which some objects +resurrect (they are reachable from outside the isolated cycles after the +finalizers have been executed), do not block the collection of all objects +that are still unreachable. Patch by Pablo Galindo and Tim Peters. |