Monitor memory saved from KSM
I am marking the allocated memory for my program as mergeable. While checking the pages shared in KSM I can see that pages are getting merged in that program.
To check how much memory is saved by page merging, I run the program with mergeable and without mergeable. But when I check with top command it shows that same amount of memory is used. I am not able to figure that if the pages are getting merged then how it is showing same amount of memory used. Please help me. Thanks in advance. |
Hi :)
I am just guessing that top "thinks" the KSM merged pages are like shared library. from process address space's point of view, those pages are still mapped on each processes, thus are counted in their RSS (resident set size). The same like your shared libraries. It might be single .so file, but mapped into say 3 programs. Well then, each of them will count this .so into their RSS, while in fact only lesser amount of file backed pages are used. Hope I explained it clearly :) |
I think its correct but that is my problem. I mean I want to monitor those savings. So if top cannot show it, then how to monitor how much memory is being saved.
Quote:
|
Hi :)
I think you need to rely on /proc/meminfo directly. IIRC, "anonpages" is what you need: Code:
grep -i anonpage /proc/meminfo |
All times are GMT -5. The time now is 12:52 AM. |