Swap space used: Why does free and top show different amounts compared to ps
Linux - NewbieThis forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Requirement
------------
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.