Portal Home > Knowledgebase > Articles Database > Swap Used is High


Swap Used is High




Posted by aniga17, 05-19-2015, 07:56 AM
Hi Why the Swap Used is very high How do i resolve this?

Posted by MrHarry, 05-19-2015, 08:42 AM
Just done a quick search of the forum and found this; http://www.webhostingtalk.com/showthread.php?t=1146872. Have you tried restarting your server to see if it drops? Have a look at that thread.

Posted by Savio13, 05-19-2015, 08:52 AM
What does free -m show? Swap is high? Also run command top and see whats eating your CPU as well.

Posted by aniga17, 05-19-2015, 08:54 AM
free -m total used free shared buffers cached Mem: 15870 2139 13731 0 184 999 -/+ buffers/cache: 955 14915 Swap: 2047 1910 137

Posted by Savio13, 05-19-2015, 08:58 AM
Just a wild guess, is there a cron job running when you noticed it? Also Linux does have the tendency to use Swap for processes that are not frequently requested, leaving the RAM freed up.

Posted by anuja9991, 05-19-2015, 09:55 AM
Hello, You can simply use swapoff -a and swapon -a commands in order free up swap memory. Its quite hard to get reliable information about which process is using swap memory. But give a try for following bash series (commands) in order to find and those processes. #========================================= #!/bin/bash SUM=0 OVERALL=0 for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do PID=`echo $DIR | cut -d / -f 3` PROGNAME=`ps -p $PID -o comm --no-headers` for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'` do let SUM=$SUM+$SWAP done echo "PID=$PID - Swap used: $SUM - ($PROGNAME )" let OVERALL=$OVERALL+$SUM SUM=0 done echo "Overall swap used: $OVERALL" #=========================== Save this code in file called 'getswap.sh' then chmod 755 getswap.sh finally ./getswap.sh

Posted by Srv24x7, 05-19-2015, 10:54 AM
Hi, What is the swappiness parameter set in the sysctl.conf file or in /proc/sys/vm/swappiness ?

Posted by TonyB, 05-19-2015, 11:58 AM
What operating system are you using? It does indeed and absolutely nothing to worry about. Unfortunately cPanel for example still considers this bad and leaves a big red exclamation point scaring users.

Posted by aniga17, 05-19-2015, 03:45 PM
OS is Linux CENTOS panel is Cpanel i am using Cloud Linux



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
2checkout - DDoS? (Views: 689)
UK2.Net Down? (Views: 737)
best RDP streaming (Views: 656)

Language: