Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i calculate system memory usage by /proc/meminfo

(MemFree + Buffers + Cached) / MemTotal

the result is as same as I saw in System Monitor.

But how to calculate a process's memory?

e.x:
/proc/22062/statm ----> 83561 4533 3331 58 0 1042 0

System Monitor ----> 6.4 MiB

I wonder how System Monitor get the 6.4 MiB.


Please tell me a right way to calculate process's real memory usage.
Posted

1 solution

/proc/<pid>/statm

(rss - shared)*4/1024
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900