On servers that are into the swap file and have multiple processes running, I often wonder if it’s MySQL that is in the swap or some other process. With Linux this is a fairly easy thing to figure out. Below is the format of a command to do just that:
echo 0 $(cat /proc/`pidof process`/smaps | grep TYPE | awk '{print $2}' | sed 's#^#+#') | bc
In the above command, TYPE refers to what type of Memory you want to examine. Below are some of the options for this value:
TYPE | Explanation |
---|---|
Private | Private memory used by the process. You may be able to determine memory leaks by looking at this value over time. |
Pss | Proportional Set Size. This is the Rss adjusted for sharing. For example, if a process has … |