In Centos, you may easily find out which process(es) is using the swap by using top command.
To do this,
1. Enter top.
2. Press O (Capital letter ‘O’).
3. Press p (Small letter ‘P’).
4. Press Enter.
Recently I’ve wrote a script to calculate the swap usage and triggered the alert when Swap usage hit the certain level.
And I found out the actual memory usage is not using as it is where swap still caching the usage. To clear the swap cache and make the memory usage only, you may turn of swap by selecting the swap drive.
First of all, you need to identify the swap disk. Check the blkid for more information.
Look at the entry of swap. Assume swap is in sda5.
Turn the swap cache off,
Once it is done, turn on again,