Sample Header Ad - 728x90

Finding actual memory usage of process

0 votes
0 answers
38 views
I have seen similar questions (https://unix.stackexchange.com/questions/35129/need-explanation-on-resident-set-size-virtual-size) , (https://unix.stackexchange.com/questions/164653/actual-memory-usage-of-a-process) , and understand the difference between RSS/VSZ. I've some uses of mmap'ing distinct virtual memory regions to the same underlying physical memory. In this case, /proc/pid/stat and /proc/pid/maps give RSS = VSZ = sum of all mappings. PSS sum is correct in this case, but I don't think summing up all PSS each time is a great way to report "actual" memory. Moreover, it will also include memory from libc and other libraries. Is this "actual memory" exposed by Linux? By actual memory, I mean: physical pages used/allocated by the process.
Asked by muser (101 rep)
Mar 3, 2025, 04:37 PM