GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-146527: Add get_gc_stats function to _remote_debugging by sergey-miryanov · Pull Request #148071 · python/cpython

Conversation

@sergey-miryanov

@sergey-miryanov sergey-miryanov commented Apr 4, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR implements second part of the issue. Instead of adding a new module or extending the gc module we add new function to the _remote_debugging module as it is a best place for this.

  • Issue: Add a module for monitoring GC statistics #146527

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot mentioned this pull request Apr 4, 2026
Add a module for monitoring GC statistics #146527
Closed
sergey-miryanov
sergey-miryanov commented Apr 4, 2026
View reviewed changes
Comment thread Modules/_remote_debugging/_remote_debugging.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sergey-miryanov

sergey-miryanov commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure about news entry too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sergey-miryanov
sergey-miryanov marked this pull request as ready for review April 12, 2026 12:19
@sergey-miryanov
sergey-miryanov requested review from a team, AA-Turner, emmatyping, erlend-aasland and pablogsal as code owners April 12, 2026 12:19
@bedevere-app bedevere-app Bot added the awaiting review label Apr 12, 2026
@sergey-miryanov

sergey-miryanov commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

@pablogsal Could you please take a look?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ashm-dev
ashm-dev reviewed Apr 15, 2026
View reviewed changes
Comment thread Modules/_remote_debugging/gc_stats.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_remote_debugging/interpreters.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sergey-miryanov
sergey-miryanov marked this pull request as draft April 16, 2026 13:56
@bedevere-app bedevere-app Bot removed the awaiting review label Apr 16, 2026
@sergey-miryanov
sergey-miryanov marked this pull request as ready for review April 16, 2026 14:18
@bedevere-app bedevere-app Bot added the awaiting review label Apr 16, 2026
pablogsal
pablogsal reviewed Apr 25, 2026
View reviewed changes
Comment thread Modules/_remote_debugging/module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sergey-miryanov
sergey-miryanov marked this pull request as draft May 1, 2026 05:37
@bedevere-app bedevere-app Bot removed the awaiting review label May 1, 2026
@sergey-miryanov
sergey-miryanov marked this pull request as ready for review May 1, 2026 09:57
@bedevere-app bedevere-app Bot added the awaiting review label May 1, 2026
sergey-miryanov added 9 commits May 2, 2026 14:35
@sergey-miryanov @pablogsal
Initial version
839e613
@sergey-miryanov @pablogsal
Write ts_stop at the end of the add_stats to determine that stats pro…
940ccd8
…perly updated
@sergey-miryanov @pablogsal
AC
672ed7a
@sergey-miryanov @pablogsal
Fix reading gc_stats according last changes
9c5abe7
@sergey-miryanov @pablogsal
Tests for get_gc_stats for main interpreter
8451cc6
@sergey-miryanov @pablogsal
Add tests for subinterpreters
85b1023
@sergey-miryanov @pablogsal
Fix all_subinterpreters handling
462086b
@sergey-miryanov @pablogsal
Add news
b341438
@sergey-miryanov @pablogsal
Update news
a16f7e1
sergey-miryanov and others added 13 commits May 2, 2026 14:38
@sergey-miryanov @pablogsal
Fix tests
71685b4
@sergey-miryanov @pablogsal
Update news entry
8886b4c
@pablogsal
Validate remote GC stats offset
f225fb4
@pablogsal
Reject mismatched GC stats layouts
98d3482
@pablogsal
Document GCMonitor GC stats API
8789da4
@pablogsal
Record free-threaded GC timestamps
465a988
@pablogsal
Rename GC stats test and add timestamp coverage
0fc7d41
@pablogsal
Use tracked objects in GC stats tests
e7413db
@pablogsal
Reject null remote GC stats pointer
aa32191
@pablogsal
Drop heap_size from GC stats docs
2d6aa03
@pablogsal
Document GC stats fields
1cafeb2
@pablogsal
Document GC stats publication order
f9d4f64
@pablogsal
Move GC stats helpers to source file
e95d13d
@pablogsal
pablogsal force-pushed the feat/gc-monitor-get branch from a929c0c to e95d13d Compare May 2, 2026 13:41
pablogsal added 2 commits May 2, 2026 14:44
@pablogsal
Return GC stats as structseq
4613271
@pablogsal
Credit GC stats contributors
da1e01d
@pablogsal

pablogsal commented May 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Thanks a lot for the great work on this @sergey-miryanov! I pushed a set of follow-up commits on top because we are getting close to beta freeze and I wanted to make sure this lands in a solid shape.

The follow-ups validate the remote GC stats offset and reject incompatible remote layoutsinstead of accepting short reads, reject a NULL remote GC stats pointer, record timestamps in the free-threaded GC path, and document why ts_stop is published last. I also moved the non-trivial GC stats implementation out of the header into gc_stats.c and updated the POSIX and Windows build files for that split. The API now returns _remote_debugging.GCStatsInfo structseq objects instead of dictionaries, matching the rest of _remote_debugging, and the docs/Clinic text now describes the fields and errors properly. I dropped heap_size from the exposed docs since it is not actually exposed by the current stats layout.

On the test side, I renamed the test file to test_gc_stats.py, added timestamp and field coverage, updated the assertions for GCStatsInfo, and changed the workload to allocate tracked self-referential containers so the candidate counts advance deterministically.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@read-the-docs-community

read-the-docs-community Bot commented May 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32509414 | 📁 Comparing 6e2c401 against main (c7b7ca2)

  🔍 Preview build  

4 files changed
± contents.html
± c-api/perfmaps.html
± whatsnew/3.15.html
± whatsnew/changelog.html
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pablogsal added 3 commits May 2, 2026 14:57
@pablogsal
Moar tests
2ef3d86
@pablogsal
Simplifications
784f9c4
@pablogsal
Moar simplification
8807407
pablogsal
pablogsal approved these changes May 2, 2026
View reviewed changes

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for this @sergey-miryanov this was such a cool idea!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels May 2, 2026
@pablogsal
pablogsal enabled auto-merge (squash) May 2, 2026 14:11
@pablogsal
Fix c flobals
6e2c401
@pablogsal
pablogsal requested a review from ericsnowcurrently as a code owner May 2, 2026 14:39
@pablogsal
pablogsal merged commit 39f123c into python:main May 2, 2026
54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label May 2, 2026
@sergey-miryanov

sergey-miryanov commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks so much, @pablogsal! You did excellent work shaping this into its final form!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
+1 more reviewer
@ashm-dev ashm-dev ashm-dev left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@sergey-miryanov @pablogsal @ashm-dev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.