Skip to content

gc.DEBUG_STATS no longer print out anything #122298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
user202729 opened this issue Jul 26, 2024 · 2 comments
Closed

gc.DEBUG_STATS no longer print out anything #122298

user202729 opened this issue Jul 26, 2024 · 2 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@user202729
Copy link

user202729 commented Jul 26, 2024

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

@user202729 user202729 added the type-bug An unexpected behavior, bug, or error label Jul 26, 2024
@encukou
Copy link
Member

encukou commented Jul 26, 2024

@markshannon Was this intentional?

@markshannon markshannon self-assigned this Aug 23, 2024
@picnixz picnixz added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 23, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 23, 2024
(cherry picked from commit 7cd3aa4)

Co-authored-by: Mark Shannon <mark@hotpy.org>
Yhg1s pushed a commit that referenced this issue Sep 2, 2024
GH-122298: Restore printing of GC stats (GH-123261)
(cherry picked from commit 7cd3aa4)

Co-authored-by: Mark Shannon <mark@hotpy.org>
Yhg1s added a commit to Yhg1s/cpython that referenced this issue Sep 29, 2024
@hugovk
Copy link
Member

hugovk commented Jan 7, 2025

Thanks for the fix and backport, let's close if nothing left to do here.

@hugovk hugovk closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants