• Pablo Galindo's avatar
    bpo-38379: Don't block collection of unreachable objects when some objects resurrect (GH-16687) · 466326dc
    Pablo Galindo authored
    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.
    466326dc
test_gc.py 42.2 KB