LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags , , , , , , , , ,

Reply
 
Thread Tools
Old 06-23-2009, 11:55 AM   #1
doublefrangelico
LQ Newbie
 
Registered: Jun 2009
Posts: 2
Thanked: 0
Question Swap space used: Why does free and top show different amounts compared to ps


[Log in to get rid of this advertisement]
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..
doublefrangelico is offline  
Tag This Post , , , , , , , , ,
Reply With Quote
Old 06-23-2009, 02:50 PM   #2
onebuck
Guru
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 5,437
Blog Entries: 1
Thanked: 202
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).
onebuck is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 09:38 PM
swap space does not show in df command surya_prakash Linux - Newbie 1 06-17-2009 11:47 PM
OOM kill of custom program despite plenty of free swap space VelocideX Linux - Software 3 05-06-2009 01:45 AM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 06:10 AM
Setup free space on /dev/hdc without screwing up /swap DavidPhillips Linux - General 4 06-24-2001 11:35 AM


All times are GMT -5. The time now is 10:28 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration