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 — [3.14] GH-148726: Add heap_size to _gc_runtime_state by sergey-miryanov · Pull Request #149025 · python/cpython

Conversation

@sergey-miryanov

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

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: Forward-port generational GC #148726

Sorry, something went wrong.

Uh oh!

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

All reactions
@sergey-miryanov
Add heap_size to _gc_runtime_state
5fc5fee
@sergey-miryanov
sergey-miryanov requested a review from nascheme April 26, 2026 19:20
@sergey-miryanov sergey-miryanov added the skip news label Apr 26, 2026
@bedevere-app bedevere-app Bot added the awaiting review label Apr 26, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 26, 2026
Forward-port generational GC #148726
Closed
@nascheme

nascheme commented Apr 27, 2026

Copy link
Copy Markdown
Member

LGTM. However, given there are no public APIs to use this heap_size value, I'm wondering if this is worth the small cost to track it. Since it was in the 3.14.0, maybe its best to restore it. Does someone have a concrete use case for it? Maybe your enhanced GC stats?

All reactions

Sorry, something went wrong.

Uh oh!

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

nascheme
nascheme approved these changes Apr 27, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 27, 2026
@sergey-miryanov

sergey-miryanov commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, we unfortunately don't have a public API for heap_size. Even my gc-stats module is only available for 3.15, because many _Py_DebugOffsets changes weren't backported.

But tools like py-spy can "reconstruct" the _gc_runtime_state layout for a specific Python version and get access to this field.

But,... now might be a good time to add 'heap_size' to the callback? :) @hugovk

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk

hugovk commented Apr 28, 2026

Copy link
Copy Markdown
Member

This PR looks okay as-is, can you update the ABI file and then summon the buildbots?

sergey-miryanov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@sergey-miryanov
Upadte python3.14.abi
9a67a99
@sergey-miryanov
sergey-miryanov requested a review from encukou as a code owner April 28, 2026 14:59
@sergey-miryanov sergey-miryanov added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 28, 2026
@bedevere-bot

bedevere-bot commented Apr 28, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @sergey-miryanov for commit 9a67a99 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F149025%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 28, 2026
@sergey-miryanov

sergey-miryanov commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Buildbots failures are unrelated - the same as in previous PR

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk
hugovk merged commit 4d0ae4c into python:3.14 Apr 29, 2026
108 of 118 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nascheme nascheme nascheme approved these changes
@encukou encukou Awaiting requested review from encukou encukou is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

4 participants

@sergey-miryanov @nascheme @hugovk @bedevere-bot
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.