Add smaps and proc_status memory usage services - #754
Open
gaber wants to merge 1 commit into
Open
Conversation
Add two new services under src/services/memusage/: * smaps: records RSS, PSS, and shared/private clean/dirty memory from /proc/self/smaps_rollup. * proc_status: records virtual memory, RSS, swap, and hugetlb usage from /proc/self/status, resetting the kernel's RSS high-water mark via /proc/self/clear_refs after each snapshot. Register both services in CMakeLists.txt, add CI tests in test_linux_services.py, and document both services in doc/sphinx/services.rst.
Member
|
Nice, thanks @gaber! This is pretty much how I would have written. I'm happy to merge it. One more thing we can do is add some ConfigManager option specs to |
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.
For context: I've been looking for ways to help applications reduce memory usage. Sometimes that means helping teams find opportunities to make greater use of shared memory. So I went looking for ways to quantify that benefit, which led me to reading proportional set size (PSS) from
/proc/self/smaps_rollup.Add two new services under src/services/memusage/:
Both implementations drew heavy inspiration from the existing memstat service (src/services/memusage/MemStatService.cpp), and since these new services also each read memory usage info from a file in
/procI put them in that same memusage subdirectory as a starting point. Happy to move, rename, refactor anything you want changed!Also: