Yaroslav <flower.m...@gmail.com> added the comment:

As I can see here 
https://github.com/python/devguide/blob/master/garbage_collector.rst#collecting-the-oldest-generation

> the GC only triggers a full collection of the oldest generation if the ratio 
> long_lived_pending / long_lived_total is above a given value (hardwired to 
> 25%)

But in the python docs here 
https://docs.python.org/3.10/library/gc.html#gc.set_threshold

> When the number of allocations minus the number of deallocations exceeds 
> threshold0, collection starts. Initially only generation 0 is examined. If 
> generation 0 has been examined more than threshold1 times since generation 1 
> has been examined, then generation 1 is examined as well. Similarly, 
> threshold2 controls the number of collections of generation 1 before 
> collecting generation 2.

As I can see here: 
https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L1456 the 
first one is correct.

We should probably fix python docs accordingly.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41455>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to