1. View version
Cat/etc/debian_version
7.8
2, look at the memory (my side is 256MB memory swap divided by 4G)
Free-m
Total used free shared buffers Cached
MEM:231 124 106 0 8 79
-/+ buffers/cache:36 194
swap:3814 0 3814
3. Using stress to simulate the occupied swap partition environment
Stress--cpu 1--io 1--vm 2--vm-bytes 15000000--vm-keep--verbose
4. Check to see that the swap partition is constantly in use
5, using script analysis under
#!/bin/bash
#--------------------------------------------------
#Created: 2015-05-20
#Author: Jimmygong
#Mail: [Email protected]
#Function:
#Version: 1.0
#--------------------------------------------------
function Swapoccupancy ()
{
Echo-e "Pid\tswap\tprogame"
Num=0
For PID in ' ls-1/proc|egrep "^[0-9]" '
Do
if [[$pid-lt 20]]
Then
Continue
Fi
Program= ' Ps-eo pid,command|grep-w $pid |grep-v Grep|awk ' {print $} '
For swap in ' grep swap/proc/$pid/smaps 2>/dev/null|awk ' {print $} '
Do
Let num= $num + $swap
Done
Echo-e "${pid}\t${num}\t${program}"
Num=0
Done|sort-nrk2|head
}
Swapoccupancy
Exit 0
6, my side of the script is to take the first 10 of the
This article is from the "7928217" blog, please be sure to keep this source http://7938217.blog.51cto.com/7928217/1653649
Shell analyzes which programs are occupied by the swap partition (stress simulation environment)