You can find that how much does special process uses swap partition by this command :
cat /proc/"PID"/status | grep "^VmSwap"
And you can find PID
by this command:
ps -A | grep "Application_name"
But if you want to find which processes are using the swap partition, you can use this script:
#!/bin/bash
for i in /proc/*/status ; do
vmswap=$(cat $i | grep "^VmSwap")
echo "$vmswap" | grep -qv ' 0 kB'
if [ $? == 0 ] && [ "$vmswap" != "" ] ; then
echo "$i : $vmswap"
fi
done
Then you can find the application name from its PID that's returned by the script.
Update: I changed this script to create log file every 10 second (you can change the time) and in that file you can see many processes from the moment you run this script up to now:
#!/bin/bash
counter=1
touch ~/swap_process_usage.log
while true ; do
echo -e "************************************\nSwap's process in count $counter " >> ~/swap_process_usage.log
for i in /proc/*/status ; do
vmswap=$(cat $i | grep "^VmSwap")
echo "$vmswap" | grep -qv ' 0 kB'
if [ $? == 0 ] && [ "$vmswap" != "" ] ; then
pid=$(echo "$i" | tr -d /proc/ | tr -d status)
proc_name=$(ps -p $pid -o comm=)
echo "$proc_name : $pid : $vmswap" >> ~/swap_process_usage.log
fi
done
sleep 10s
counter=$((counter+1))
done
And you can set this script to run at startup so it creates log every time.
vm.swappiness
might be set high, which can push things into swap if the OS thinks it won't need them for a long time, even if there's plenty of open RAM.