Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
获取驻留集大小很简单(getrusage()或/proc/self/statm),但我如何获取交换量?从man 5 proc大约/proc/self/stat:
getrusage()
/proc/self/statm
man 5 proc
nswap %lu Number of pages swapped (not maintained). cnswap %lu Cumulative nswap for child processes (not maintained).
还有其他想法吗?
检查你是否VmSwap在/proc/$PROCESS/status. 例如:grep VmSwap /proc/1/status
VmSwap
/proc/$PROCESS/status
grep VmSwap /proc/1/status