I have an ubuntu vps running that has about 300MB of memory, of which only 20% or less is free right now ...
My question is, how can I figure out what particular program I'm running that is causing it to swap so much?
Asked
Active
Viewed 1.5k times
4
trustfundbaby
- 215
4 Answers
2
start with running
top
and pressing M [ shift+m ].
you will get process list sorted by mem consumption.
pQd
- 30,537
1
smem is a bit harder to use than top, but offers good information. You could start with with sudo smem -s uss -r -k which will output:
PID User Command Swap USS PSS RSS
12345 spam /usr/lib/jvm/java-6-sun/bin 0 620.9M 0 626.5M
98765 eggs /usr/bin/java -Xmx1500m -XX 0 544.2M 0 549.9M
You might also want to check out this lwn.net article, which explains the difference between RSS, PSS and USS.
miki
- 176
- 3
0
Another option is htop, which has better output in some cases.
Skyhawk
- 14,230
The Unix Janitor
- 2,558
- 15
- 13