Repository navigation
fix(diagnostics): report OS-truth RSS, not mimalloc's Linux commit counter - #1516
Merged
Merged
Conversation
…unter Both Linux soak-quick legs in the dry run failed with: FAIL: RSS 17592186044293MB > 200MB ceiling 17592186044293 MB is 2^44-123 -- a NEGATIVE ~123MB wrapped through size_t. The diagnostics snapshot reported mi_process_info()'s current_rss verbatim, and on Linux mimalloc never sets that field: it keeps mimalloc's internal committed-page counter, which this project deliberately tunes low (purge_decommits=1, purge_delay=0) and which can transiently go negative under purge. macOS and Windows are untouched -- mimalloc reports real RSS there -- which is exactly the observed split: both Linux legs red, both macOS legs green. mem.c already learned this lesson in full (its comment block documents the same trap for cbm_mem_over_budget): cbm_mem_rss() is /proc-statm-primary on Linux and mimalloc-correct elsewhere, and cbm_mem_peak_rss() reconciles peak >= current. The diagnostics writer now uses both instead of the raw mi fields, so the soak leak gates measure actual process RSS on every platform. Verified: diagnostics suite passes; compiles and formats clean. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
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.
Both Linux
soak-quicklegs in dry run 31364739675 failed withFAIL: RSS 17592186044293MB > 200MB ceiling— that value is 2^44−123, i.e. −123 MB wrapped throughsize_t, not a leak.The diagnostics snapshot reported
mi_process_info()current_rssverbatim. On Linux mimalloc never sets that field; it keeps mimalloc-internal committed-page accounting, which this project deliberately tunes low (purge_decommits=1,purge_delay=0) and which can transiently go negative under purge. macOS/Windows are unaffected (mimalloc reports real RSS there) — matching the observed split exactly: both Linux legs red, both macOS legs green, same binary.mem.calready encodes the full lesson forcbm_mem_over_budget(documented in its comment block):cbm_mem_rss()is/proc/self/statm-primary on Linux and mimalloc-correct elsewhere;cbm_mem_peak_rss()reconciles peak ≥ current. The diagnostics writer now uses both.Verified: diagnostics suite passes locally; compiles + clang-format clean. Dry run re-dispatch follows the merge.