How to measure swap usage on Linux


On Linux (since version 2.6.14):

1- find out the pid of a process  
2- navigate to /proc/pid
3- edit the smaps file, and sum the swap value for each of the process mappings.

... or use the script found here to get the swap usage for each running process. The display below has been obtained by running that script on a Ubuntu guest OS (using Virtualbox on Windows) with base memory set at 128M.
















 All swaps values in kilobytes.

No comments:

Post a Comment