-
-
Notifications
You must be signed in to change notification settings - Fork 155
arena: recycled-block pool — block round-trips through the allocator were the tree.ts RSS term (#7438) #7449
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b0a1d9d
gc(diag): the sweep blocks line labeled every non-general block 'long…
e13ae07
arena: recycled-block pool — released blocks are reused, not round-tr…
96153d5
arena(pool): pin the cap at 64 MB with the measured tradeoff
63569a7
changelog: fragment for #7449
028a266
arena(pool): give the recycled-block pool ownership of its blocks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| **Arena: recycled-block pool** (#7438 progress) — released 1 MB arena blocks were round-tripped through the process allocator, so each promoted-then-dropped cohort's replacement blocks landed in fresh mimalloc segments and the union of ever-dirtied pages grew with *cumulative promotion volume*: tree.ts peaked at 257.5 MiB committed scavenge-on vs 140.5 MiB scavenge-off for a ~35 MB live set, and a cap matrix showed the young-cap dial barely moves RSS (64/32/16 MB effective caps → 235/221/226 MB) while doubling wall time. | ||
|
|
||
| Released blocks now enter a capped 64 MB thread-local pool and the single block-reservation funnel reuses them before minting fresh mappings. Pooled pages are `MADV_FREE`'d (the OS reclaims them under pressure; contents are undefined on reuse, which every consumer tolerates — blocks are bump-filled from offset 0 and re-registered by the adopting arena). The cap is measured, not guessed: no pool → 225 MB tree peak RSS, 64 MB → 190 MB, 128 MB → 210 MB (an oversized pool holds resident freed pages past the optimum). No collection decision changes — GC counters are byte-identical, so the pinned gc-ratchet baseline stands. Thread teardown still frees for real. | ||
|
|
||
| Measured (dedicated M1 bench host, same-session A/B): tree.ts 225 → **190 MB** peak RSS at wall parity (9.85 s vs 9.96 s); deeplist 166 → 158 MB; churn/cycles/retain and the scavenge-off arm unchanged. Also relabels the sweep DIAG line that printed every non-general block as `longlived=` (it now says `non_general=` — the old label read as an 84 MB longlived leak on a workload whose longlived arena holds 1 MB). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.