refactor(memory): size admissions from one resident-memory view - #2785
Merged
Merged
Conversation
Worker slabs, decode admission, and text-artifact builds each combined the ledger and a fresh RSS measurement themselves. They now all read ProcessResidentMemoryV1::headroom_below: the ceiling less the larger of the charged ledger and the measured process, zero while latched, the same bounds reserve() enforces. Measured RSS remains that view's input for the runtime and allocator memory no owner is charged for; it is not yet a small fixed allowance (155-180 MB at rest on the heavy corpus), so it cannot be replaced by a constant.
|
This was referenced Oct 1, 2026
14 of 16 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Worker slab sizing, decode admission and text-artifact build sizing each combined the reservation ledger with a fresh RSS measurement on their own. They now all read
ProcessResidentMemoryV1::headroom_below(ceiling). That view returns the ceiling minus the larger of the charged ledger and the measured process, or zero while latched, which are the boundsreserve()already enforces. The separate measured-RSS sizing path inreserve_worker_memoryis deleted.Measured RSS is still the view's single input for the runtime and allocator memory that no owner is charged for. That memory is not yet small or fixed: 135–250 MB at rest, depending on the corpus (see #2784). So it cannot become a constant allowance yet, and this PR does not claim it has.
Tests
resident_memory(50 passed): the new test walks the view through ledger reservation, a ceiling, a refused oversize reserve, a measurement over the limit (latched) and the latch holding.code_index_scheduler(445 passed, 1 ignored): covers slab, decode and text-budget admission.Refs #2490, #2525