Skip to content

feat(allocator): record byte size of arena chunk allocations#24554

Closed
Boshen wants to merge 1 commit into
mainfrom
allocs-chunk-alloc-bytes
Closed

feat(allocator): record byte size of arena chunk allocations#24554
Boshen wants to merge 1 commit into
mainfrom
allocs-chunk-alloc-bytes

Conversation

@Boshen

@Boshen Boshen commented Jul 15, 2026

Copy link
Copy Markdown
Member

Second of three PRs splitting the byte-metrics work (stacked on the arena-size PR); no snapshot changes.

The track_allocations tracking already counts how many chunks arenas request from the system allocator, so tasks/track_memory_allocations can exclude them from its system-allocator counts — chunk requests would otherwise make the counts platform-dependent (see #22621). This records the total byte size of those chunks too, and extends the accessor to Allocator::global_chunk_allocation_stats() -> (count, bytes), matching the existing get_allocation_stats() shape.

This enables the next PR to exclude chunk bytes from a new total-heap-allocated-bytes metric, the same way chunk counts are excluded from sys allocs today.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the A-allocator Area - Allocator label Jul 15, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing allocs-chunk-alloc-bytes (f0a9bb7) with main (71c2f53)2

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (510c435) during the generation of this report, so 71c2f53 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Boshen commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@graphite-app
graphite-app Bot changed the base branch from allocs-snap-arena-bytes to graphite-base/24554 July 15, 2026 13:21
@graphite-app
graphite-app Bot force-pushed the graphite-base/24554 branch from 6caed9b to 510c435 Compare July 15, 2026 13:25
@graphite-app
graphite-app Bot force-pushed the allocs-chunk-alloc-bytes branch from 87cc31d to 05eda40 Compare July 15, 2026 13:25
@graphite-app
graphite-app Bot changed the base branch from graphite-base/24554 to main July 15, 2026 13:26
The `track_allocations` tracking already counts how many chunks arenas
request from the system allocator (so `tasks/track_memory_allocations` can
exclude them from its system-allocator counts, which chunk requests would
otherwise make platform-dependent — see #22621). Record the total byte size
of those chunks too, and extend the accessor to
`Allocator::global_chunk_allocation_stats() -> (count, bytes)`, matching the
`get_allocation_stats()` shape.

No snapshot changes. This enables the next commit to exclude chunk bytes
from a new total-heap-allocated-bytes metric, the same way chunk counts are
excluded from `sys allocs` today.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@graphite-app
graphite-app Bot force-pushed the allocs-chunk-alloc-bytes branch from 05eda40 to f0a9bb7 Compare July 15, 2026 13:26
@Boshen Boshen closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant