Repository navigation
[linux] Exclude the ring from max RSS - #151
Open
ngorogiannis wants to merge 1 commit into
Open
ngorogiannis wants to merge 1 commit into
ngorogiannis wants to merge 1 commit into
Conversation
ngorogiannis
force-pushed
the
linux-rss-without-ring
branch
from
September 23, 2026 07:25
4fcaef8 to
17062a7
Compare
ngorogiannis
force-pushed
the
linux-rss-without-ring
branch
3 times, most recently
from
September 30, 2026 07:55
17062a7 to
38c54f2
Compare
ngorogiannis
force-pushed
the
linux-rss-without-ring
branch
3 times, most recently
from
November 10, 2026 18:27
09e4927 to
70211a2
Compare
ngorogiannis
marked this pull request as draft
November 11, 2026 08:03
ngorogiannis
force-pushed
the
linux-rss-without-ring
branch
4 times, most recently
from
November 13, 2026 14:14
d5dc5fe to
5108534
Compare
The ring is mmap'd into the traced process, so its resident pages were counted in max_rss_kb: a 512MB ring against a 3MB live set reported 106MB (#104). gc-stats now reports the traced program's RSS minus the ring RSS. Where the ring cannot be attributed, the output says so. The Linux arm locates the ring's mapping in /proc/<pid>/maps and counts its resident pages from /proc/<pid>/pagemap. Those are the same page tables VmRSS is drawn from, so the ring's pages are a subset of the RSS by construction and the subtraction is exact. The address range is found once and remembered, since the mapping never moves. The walk runs with the runtime lock released, so the poller domain cannot stall the domain draining the ring. Because only the current RSS can be decomposed, Linux now reports VmRSS and the poller takes the peak of the difference; it falls back to the kernel's exact VmHWM when the ring cannot be attributed. The poller ignores samples whose RSS reads as zero (in case the process exited before olly checks) so they no longer mark an otherwise sound run's peak as untrustworthy. The json output is now version 3 and carries max_rss_excludes_ring, false wherever the ring could not be attributed. The field is required, so a version 2 document no longer decodes; validate-gc-stats accepts 1 <= version <= 3 and, in jsonlines mode, still skips the lines whose version is not the current one. Also splits the C stub so that each platform arm supplies only platform_sample and the FFI entry point exists once, making a detached macOS and FreeBSD still report the RSS with the ring included, and are left as further work.
ngorogiannis
force-pushed
the
linux-rss-without-ring
branch
from
November 13, 2026 14:16
5108534 to
76d3e12
Compare
ngorogiannis
marked this pull request as ready for review
November 13, 2026 14:16
edwintorok
approved these changes
Nov 13, 2026
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.
The ring is mmap'd into the traced process, so its resident pages were
counted in max_rss_kb: a 512MB ring against a 3MB live set reported
106MB (#104).
gc-stats now reports the traced program's RSS minus the ring RSS. Where
the ring cannot be attributed, the output says so.
The Linux arm locates the ring's mapping in /proc//maps and counts
its resident pages from /proc//pagemap. Those are the same page
tables VmRSS is drawn from, so the ring's pages are a subset of the RSS
by construction and the subtraction is exact. The address range is found
once and remembered, since the mapping never moves. The walk runs with
the runtime lock released, so the poller domain cannot stall the domain
draining the ring.
Because only the current RSS can be decomposed, Linux now reports VmRSS
and the poller takes the peak of the difference; it falls back to the
kernel's exact VmHWM when the ring cannot be attributed. The poller
ignores samples whose RSS reads as zero (in case the process exited
before olly checks) so they no longer mark an otherwise sound run's peak
as untrustworthy.
The json output is now version 3 and carries max_rss_excludes_ring,
false wherever the ring could not be attributed. The field is required,
so a version 2 document no longer decodes; validate-gc-stats accepts
1 <= version <= 3 and, in jsonlines mode, still skips the lines whose
version is not the current one.
Also splits the C stub so that each platform arm supplies only
platform_sample and the FFI entry point exists once, making a detached
macOS and FreeBSD still report the RSS with the ring included, and are
left as further work.
Stack created with GitHub Stacks CLI • Give Feedback 💬