Objective
Welcome everyone I share and recommend useful code Snippets ~ ~
Statement
Welcome reprint, but please keep the original source of the article:
CSDN:http://www.csdn.net
rainy season o mo away:http://blog.csdn.net/luckkof
Body
[Description]
For the LCA version, there is usually a swap config open, so how do you see the memory swap information for the system?
[Keyword]
Memory Swap LCA
[Solution]
1. The memory swap information of the whole system can read/proc/meminfo information directly, there are two lines:
Swaptotal:xxxx KB
swapfree:yyyy KB 2. The memory swap information of a process can read/proc/{pid}/status information, including:
vmpeak:480944 KB
vmsize:480936 KB
vmlck:0 KB
vmpin:0 KB
vmhwm:19180 KB
vmrss:19180 KB
vmdata:12352 KB
vmstk:136 KB
Vmexe:8 KB
vmlib:35656 KB
vmpte:96 KB
Vmswap:xxx KB
Vmswap that was the swap memory