Resident memory reported significantly lesser than Proportional Resident memory - Process Exporter and Grafana
0
votes
0
answers
179
views
I have a process monitoring stack setup with process exporter and Grafana with the "process profiling with treemap" dashboard, and I see some suspicious behaviour regarding the memory it is reporting.
Based on my understanding (Having read [this](https://unix.stackexchange.com/questions/33381/getting-information-about-a-process-memory-usage-from-proc-pid-smaps) article and the links mentioned within that article):
RSS = Private memory + shared memory
PSS = Private memory + (shared memory / num of processes sharing said memory)
This leads me to believe that RSS >= PSS at any given time.
Here is what I observe:
1. Process takes 39.2GB of virtual memory
[process alloted 39.2GB virtual memory](https://i.sstatic.net/zOFaMpz5.png)
2. Process takes up 38.1GB of "proportional resident memory", this makes sense
[Process takes up 38.1GB proportional resident memory](https://i.sstatic.net/BC3QAWzu.png)
3. This is where this get suspicious, process takes up only 18.8GB of resident memory.
[Process takes only 19.2GB resident memory](https://i.sstatic.net/ZlsbQymS.png)
Is my understanding of how RSS and PSS works correct? If yes, what could be the reasons this process is behaving like this(or being reported as such). I suspected process exporter or grafana might be incorrect but no other process reports something suspicious like this so im assuming they're working as expected.
I looked at the process exporter github to confirm if my understanding of the fields reported by it is correct.
resident: Field rss(24) from /proc/[pid]/stat, whose doc says:
This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.
proportionalResident: Sum of "Pss" fields from /proc/[pid]/smaps, whose doc says:
The "proportional set size" (PSS) of a process is the count of pages it has in memory, where each page is divided by the number of processes sharing it.
No pages have been swapped out.
Here are the queries used by Grafana to graph these:
proportional resident memory:
namedprocess_namegroup_memory_bytes{instance=~"$instance", memtype="proportionalResident"} > 0
virtual memory:
namedprocess_namegroup_memory_bytes{instance=~"$instance", memtype="virtual"}
resident memory:
namedprocess_namegroup_memory_bytes{instance=~"$instance", memtype="resident"} / ignoring(memtype) namedprocess_namegroup_num_procs > 0
All other processes behave expectedly with RSS >= PSS. Why could this process be reporting this behaviour?
TIA!
Asked by Phantom
(1 rep)
Oct 15, 2024, 09:34 AM