Check which processes are eating swap on Linux?
Solution 1:
- Run
top
- Press
f
to select displayed fields - Navigate down to SWAP using arrow keys
- Hit
Space
- SWAP will become preceded by asterisk*
- Press right arrow key - this will allow you to move SWAP to a convenient place in the listing, for example between %MEM and TIME+
- Press q to return to top view
Step 5 isn't necessary, just convenience - without it SWAP will be showing up as the last entry of the list, after COMMAND
.
Solution 2:
You can use smem
command line tool.
smem manpages:
Memory can be reported by process, by user, by mapping,
or systemwide. Both text mode and graphical output are available.
smem memory reporting tool