On a Debian Linux 3.16 machine, I have 244 MB of swap space used:
# free -h total used free shared buffers cached Mem: 94G 36G 57G 1.9G 3.8G 11G -/+ buffers/cache: 20G 73G Swap: 487M 244M 243M Looking at this, I cannot find 244 MB used.
# for file in /proc/*/status ; do grep VmSwap $file; done | sort -nk 2 | tail VmSwap: 0 kB VmSwap: 0 kB VmSwap: 0 kB VmSwap: 0 kB VmSwap: 0 kB VmSwap: 0 kB VmSwap: 4 kB VmSwap: 12 kB VmSwap: 16 kB VmSwap: 36 kB And I only have 34 MB of SwapCached:
# grep -i swap /proc/meminfo SwapCached: 34584 kB SwapTotal: 499708 kB SwapFree: 249388 kB Kernel doc says about this:
SwapCached: Memory that once was swapped out, is swapped back in but still also is in the swapfile (if memory is needed it doesn't need to be swapped out AGAIN because it is already in the swapfile. This saves I/O)
How can I know which process is using my swap space on my Linux system? More precisely: Where are consumed each of those 244 MB of swap?
SwapCachedcan also be seen as stuff that was swapped out, and was later needed. And you don't have much swapped out, and can not have much swapped out. Why do you have a swap space at all?