René's URL Explorer Experiment


Title: Add a module for monitoring GC statistics · Issue #146527 · python/cpython · GitHub

Open Graph Title: Add a module for monitoring GC statistics · Issue #146527 · python/cpython

X Title: Add a module for monitoring GC statistics · Issue #146527 · python/cpython

Description: Feature or enhancement Proposal: I propose adding a new internal module to read the gathered statistics from GC. It is supposed to work out-of-process, so we can read and show statistics in non-intrusive way and without any pauses of the...

Open Graph Description: Feature or enhancement Proposal: I propose adding a new internal module to read the gathered statistics from GC. It is supposed to work out-of-process, so we can read and show statistics in non-int...

X Description: Feature or enhancement Proposal: I propose adding a new internal module to read the gathered statistics from GC. It is supposed to work out-of-process, so we can read and show statistics in non-int...

Opengraph URL: https://github.com/python/cpython/issues/146527

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a module for monitoring GC statistics","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nI propose adding a new internal module to read the gathered statistics from GC.\nIt is supposed to work out-of-process, so we can read and show statistics in non-intrusive way and without any pauses of the monitored process.\n\nTo achieve this goal, we need to follow these steps:\n1. Extend `_PyDebugOffset` with a pointer and size to the GC stats from `_gc_runtime_state`.\n2. Add more data to the GC stats(see below).\n3. Add a small module that connects to the process you're monitoring and displays statistics.\n\nI have a working prototype.\n\nI have added the following extra data to GC stats:\n- ts_start - the timestamp of the GC collect start\n- ts_stop - the timestamp of the GC collect stop\n- heap_size - the number of live objects.\n- work_to_do - an internal value from incremental GC. It controls the number of objects that are processed by one increment.\n- object_visits - the number of objects that were visited during GC work.\n- objects_transitively_reachable - the number of objects that were reachable from the global and local roots when incremental GC is called.\n- objects_not_transitively_reachable - the number of objects that were reachable while increment was constructed.\n\nWith this module we can build tools, that gathers stats in the \"real-time\" and output it to various formats. For example, we can format data to use in [Perfetto UI](https://ui.perfetto.dev/) (image from dpo post):\n\n\u003cimg width=\"2014\" height=\"735\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/2c8265cb-e5b8-48dd-88cb-9dff140db6eb\" /\u003e\n\nI want to create two PRs, one for `_PyDebugOffset` and GC stats changes, and one for new module. \n\nI want to start from GIL-enabled build. \n\ncc @pablogsal @markshannon @nascheme @colesbury \n\nAlso link to the issue https://github.com/python/cpython/issues/131253\n\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\nhttps://discuss.python.org/t/add-a-module-for-monitoring-gc-statistics/106695\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-146532\n* gh-148057\n* gh-148071\n* gh-149284\n* gh-150969\n* gh-150970\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sergey-miryanov","@type":"Person","name":"sergey-miryanov"},"datePublished":"2026-03-27T16:25:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/146527/cpython/issues/146527"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1dee7af3-6c53-230a-96c9-752c6b6306f8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE28E:C257A:954A99:D38BAE:6A510947
html-safe-nonce9c6901afec84af13aedc153e93b45e3d788c52efd9f91b06d7f2277d02d5bcfa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjhFOkMyNTdBOjk1NEE5OTpEMzhCQUU6NkE1MTA5NDciLCJ2aXNpdG9yX2lkIjoiMTM2NTM1ODkwODIwMjM1NTAxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbb67d6c5729d2c24e2ee311bf58fc474b886455bdafad2e4df24b20f41b4f647
hovercard-subject-tagissue:4154168719
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/146527/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3ef78f633bf57a8e5c585fb21e2e6d218adc6e4c7bdd85fb012a6102f4f22ef3/python/cpython/issues/146527
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ef78f633bf57a8e5c585fb21e2e6d218adc6e4c7bdd85fb012a6102f4f22ef3/python/cpython/issues/146527
og:image:altFeature or enhancement Proposal: I propose adding a new internal module to read the gathered statistics from GC. It is supposed to work out-of-process, so we can read and show statistics in non-int...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesergey-miryanov
hostnamegithub.com
expected-hostnamegithub.com
Noneb076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2d129404fc45ea64edb1b98567c53e55b395536f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/146527#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F146527
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F146527
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/146527
Reloadhttps://github.com/python/cpython/issues/146527
Reloadhttps://github.com/python/cpython/issues/146527
Please reload this pagehttps://github.com/python/cpython/issues/146527
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/146527
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Add a module for monitoring GC statisticshttps://github.com/python/cpython/issues/146527#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Mar 27, 2026https://github.com/python/cpython/issues/146527#issue-4154168719
Perfetto UIhttps://ui.perfetto.dev/
https://private-user-images.githubusercontent.com/67315/570517389-2c8265cb-e5b8-48dd-88cb-9dff140db6eb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM2OTU5ODgsIm5iZiI6MTc4MzY5NTY4OCwicGF0aCI6Ii82NzMxNS81NzA1MTczODktMmM4MjY1Y2ItZTViOC00OGRkLTg4Y2ItOWRmZjE0MGRiNmViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzEwVDE1MDEyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyOTQxYTc5MTE3ODFiOTJkMTE1ZTBlOWQ4NGRjYjg0ZjAyZmYzNjBjMzY3YTgwY2E3OTY2ZWVhOGJiNzYyNzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.TlPTTNLpkBQt9i_AlouT5sArorIjQJMCWyIme75D5Qw
@pablogsalhttps://github.com/pablogsal
@markshannonhttps://github.com/markshannon
@naschemehttps://github.com/nascheme
@colesburyhttps://github.com/colesbury
#131253https://github.com/python/cpython/issues/131253
https://discuss.python.org/t/add-a-module-for-monitoring-gc-statistics/106695https://discuss.python.org/t/add-a-module-for-monitoring-gc-statistics/106695
GH-146527: Add more data to GC statistics and add it to PyDebugOffsets #146532https://github.com/python/cpython/pull/146532
gh-146527: Heap-allocate gc_stats to avoid bloating PyInterpreterState #148057https://github.com/python/cpython/pull/148057
GH-146527: Add get_gc_stats function to _remote_debugging #148071https://github.com/python/cpython/pull/148071
gh-146527: Remove private module entry from what's new #149284https://github.com/python/cpython/pull/149284
gh-146527: Fix memory leak in _PyGC_Fini() #150969https://github.com/python/cpython/pull/150969
[3.15] gh-146527: Fix memory leak in _PyGC_Fini() (GH-150969) #150970https://github.com/python/cpython/pull/150970
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.