LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux 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

Reply
 
Search this Thread
Old 06-23-2009, 10:55 AM   #1
doublefrangelico
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
Question Swap space used: Why does free and top show different amounts compared to ps


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 11:31 AM.
 
Old 06-23-2009, 01:50 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,139
Blog Entries: 3

Rep: Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405Reputation: 1405
Hi,

Remember things are a snapshot not absolute thus changing.

Quote:
excerpt 'man ps';

vsize VSZ virtual memory usage of entire process. vm_lib + vm_exe + vm_data + vm_stack

vsz VSZ virtual memory size of the process in KiB
(1024-byte units). Device mappings are currently excluded;
this is subject to change. (alias vsize).
 
1 members found this post helpful.
  


Reply

Tags
free, linux, memory, ps, ram, swap, top, virtual


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesnt top or free show swap memory usage ? exceed1 Linux - General 15 08-03-2009 08:38 PM
swap space does not show in df command surya_prakash Linux - Newbie 1 06-17-2009 10:47 PM
OOM kill of custom program despite plenty of free swap space VelocideX Linux - Software 3 05-06-2009 12:45 AM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 05:10 AM
Setup free space on /dev/hdc without screwing up /swap DavidPhillips Linux - General 4 06-24-2001 10:35 AM


All times are GMT -5. The time now is 04:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration