Skip to content

GH-148726: Add heap_size to generational GC#149195

Merged
pablogsal merged 11 commits intopython:mainfrom
sergey-miryanov:feat/gc-gen-3.15+heap_size
May 4, 2026
Merged

GH-148726: Add heap_size to generational GC#149195
pablogsal merged 11 commits intopython:mainfrom
sergey-miryanov:feat/gc-gen-3.15+heap_size

Conversation

@sergey-miryanov
Copy link
Copy Markdown
Contributor

@sergey-miryanov sergey-miryanov commented Apr 30, 2026

@sergey-miryanov sergey-miryanov changed the title Add heap_size to generational GC GH-148726: Add heap_size to generational GC Apr 30, 2026
@nascheme
Copy link
Copy Markdown
Member

LGTM.

@hugovk hugovk added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 1, 2026
@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @hugovk for commit 2281499 🤖

Results will be shown at:

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

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 1, 2026
@sergey-miryanov
Copy link
Copy Markdown
Contributor Author

Good catch by @DinoV in #149241. I believe we should cherry-pick those commits here.

@hugovk
Copy link
Copy Markdown
Member

hugovk commented May 2, 2026

Good catch by @DinoV in #149241. I believe we should cherry-pick those commits here.

Good idea.

@sergey-miryanov sergey-miryanov requested a review from pablogsal as a code owner May 3, 2026 12:27
@sergey-miryanov
Copy link
Copy Markdown
Contributor Author

@zanieb @nascheme Could you please take another look? I've ported the 3.14 heap_size changes and included heap_size in get_gc_stats.

@DinoV FYI, the layout of _gc_runtime_state will change since we moved generation_stats to the heap.

@nascheme
Copy link
Copy Markdown
Member

nascheme commented May 3, 2026

I'd say for 3.15 we don't need the two dummy members and we could move generation0 back to it's old position. Preserving the member offsets should not be required for 3.15, right?

@sergey-miryanov
Copy link
Copy Markdown
Contributor Author

Since we're moving the stats to the heap, all subsequent offsets will shift anyway. There's no need to keep the dummy members.

I thought this would simplify backports if needed.

I'm happy to remove the dummy members and restore generation0 if you think that's cleaner.

@nascheme
Copy link
Copy Markdown
Member

nascheme commented May 4, 2026

I'm happy to remove the dummy members and restore generation0 if you think that's cleaner.

I think it's better to remove the dummy members. You don't have to restore generation0 since the code looks fine without that member. Other than that, this PR looks fine to me.

@sergey-miryanov
Copy link
Copy Markdown
Contributor Author

@nascheme Thanks! Done.

Copy link
Copy Markdown
Member

@pablogsal pablogsal left a comment

Choose a reason for hiding this comment

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

Great job @sergey-miryanov

@pablogsal pablogsal merged commit e89568f into python:main May 4, 2026
69 checks passed
@sergey-miryanov
Copy link
Copy Markdown
Contributor Author

Thanks all!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants