[New-bugs-announce] [issue46912] Full gc collection blocked from collecting after some amount of objects in oldest gen

Alexei Komarov report at bugs.python.org
Thu Mar 3 09:48:34 EST 2022


New submission from Alexei Komarov <al3x3i.k at gmail.com>:

Hi!

Maybe it is just my misunderstanding of the mechanism, so please excuse me if it is so. Looking at the GC module code, I think that once there are X objects in the oldest gen, a full collection blocked due to the condition https://github.com/python/cpython/blob/3.10/Modules/gcmodule.c#L1465-L1467 being always True.

So, if youngest gen is collected each 700 objects, the middle gen will have maximum 7000 objects. Full collection will be triggered each ~70K objects. X/4 = 70000 ===> X=280000. If oldest gen has >280K objects in it, the condition for full collection (long_lived_pending < gcstate->long_lived_total / 4) is always true since to my understanding, long_lived_pending is 70K at most, and got zeroed each full collection (https://github.com/python/cpython/blob/3.10/Modules/gcmodule.c#L1253).

----------
components: Extension Modules
messages: 414444
nosy: al3x3i.k
priority: normal
severity: normal
status: open
title: Full gc collection blocked from collecting after some amount of objects in oldest gen
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46912>
_______________________________________


More information about the New-bugs-announce mailing list