Swap space used: Why does free and top show different amounts compared to ps
My basic need was to determine why one of our Java apps ran out of memory on a Red hat server.
This led me to try and determine the amount of memory used.
This of course, took me me further into investigating how much Physical RAM and Swap Space was used by the app and in general.
This is what I tried
I have run the free -mt command which shows that the OS uses 0k swap space and has 5gb free.
The top command shows that the OS has 128k swap space used and 5gb free
However when I run the ps aux command the VSZ column shows that the app uses 2626456 (not sure if this is bytes or kb but that's beside the point)
The confusing part is that the VSZ is different to the swap space shown in the first 2 commands. Shouldn't the swap space be the same or bigger than the VSZ for that app (or the same as the total for all apps VSZ)
My assumption is that VSZ=virtual Size=Virtual memory=Swap memory
Is there something about VSZ which I don't understand?
How do I reliably determine how much RAM and how much swap space a process is using?
Thanks in advance
Last edited by doublefrangelico; 06-23-2009 at 12:31 PM.