python / cpython

The Python programming language
https://www.python.org
Other
62.42k stars 29.97k forks source link

gc.DEBUG_STATS no longer print out anything #122298

Open user202729 opened 1 month ago

user202729 commented 1 month ago

Bug report

Bug description:

The command gc.set_debug(gc.DEBUG_STATS) no longer prints out any statistics, even though gc.set_debug(gc.DEBUG_COLLECTABLE) shows that the gc is still being run.

(Probably caused by the incremental GC implementation, #116206 .)

For testing you can use the following code --- in previous Python versions the collecting generation 0 text is printed, now it's not

import gc
import sys
from time import sleep
gc.set_debug(gc.DEBUG_STATS | gc.DEBUG_COLLECTABLE)

for __ in range(3000):
    a=[1]
    a[0]=a
    del a
    print(__)
    sleep(0.001)

sys.exit()

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

encukou commented 1 month ago

@markshannon Was this intentional?