LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-15-2008, 10:11 PM   #1
weijie90
LQ Newbie
 
Registered: Apr 2005
Posts: 16

Rep: Reputation: 0
Why is VSZ more than RSS in ps aux even if I'm not using any swap?


Hi,

Many entries displayed by ps aux show that the virtual memory (VSZ) used higher than the real amount of RAM for many processes. For example:

Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   1584   536 ?        Ss   10:43   0:00 init [3]
However, I'm not using any swap:

Code:
             total       used       free     shared    buffers     cached
Mem:           881        527        353          0         19        190
-/+ buffers/cache:        317        564
Swap:          980          0        980
Why is this happening?

Thanks!
 
Old 08-16-2008, 03:58 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Look at this link:
http://www.mozilla.org/projects/foot...int-guide.html

Quote:
RSS:
Resident set size = the non-swapped physical memory that a task has used; Resident Set currently in physical memory including Code, Data, Stack

VSZ:
Virtual memory usage of entire process = VmLib + VmExe + VmData + VmStk
To put it differently:
http://www.memorymanagement.org/glossary/r.html
Quote:
resident set

In a virtual memory(1) system, a process' resident set is that part of a process' address space which is currently in main memory. If this does not include all of the process' working set, the system may thrash.
In other words,
a) VSZ *includes* RSS
b) "ps -aux" alone isn't enough to tell you if a process is thrashing (although, if your system *is* thrashing, "ps -aux" will help you identify the processes experiencing the biggest hits).

'Hope that helps .. PSM
 
Old 08-16-2008, 06:54 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I suspect the OP is aware of basic virtual storage concepts - hence the question.
Most of the (unaccounted) virtual will be for the shared libraries - that is handled via the page cache. Swap is only used for (dirty) anonymous pages. Probably being contained within the swap cache, without need to be actually swapped to disk.
Init is a bad example to look at BTW - have a look at a userspace process - /proc/<pid>/smaps will be helpful.
 
Old 08-20-2008, 11:56 AM   #4
aznblood
LQ Newbie
 
Registered: Aug 2008
Posts: 2

Rep: Reputation: 0
sorry that I hijack your thread; but I have a similar problem and i do not understand.

weijie90,

from your thread post; i dont know if the data are both in kbs or megs. Top usually display data in kbs, and free typically in kbs. but saying that you have 881 kbs in your system is impossible. So i assume that you have 881megs of ram space total. which makes sense, your application only uses 1.584 meg of virtual memory.


Well, my problem is, my process memory is more than my RAM memory given that I do not use any disk swap memory. Can this be possible. Here is an illustration:


Free mem in Kbs

total used free shared buffers
Mem: 118648 61824 56824 0 3204
Swap: 0 0 0
Total: 118648 61824 56824


------------------------------------------------------------------------------

memory used by application :

Load average: 0.81 0.77 0.71
PID USER STATUS VSZ PPID %CPU %MEM COMMAND
22018 root S 150M 3244 0.1130.1 xpod

-------------------------------------------------------------------------------

Memory status of application:

State: S (sleeping)
SleepAVG: 98%
Tgid: 22018
Pid: 22018
PPid: 3244
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 256
Groups:
VmPeak: 155552 kB
VmSize: 154528 kB
VmLck: 0 kB
VmHWM: 3744 kB
VmRSS: 3744 kB
VmData: 150372 kB
VmStk: 84 kB
VmExe: 664 kB
VmLib: 2844 kB
VmPTE: 88 kB
Threads: 13


Question: Why is my application using 150megs of memory while I only have 128megs of ram on my computer total?

Thank you
 
Old 08-20-2008, 06:02 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Such are the joys of "virtual" - nothing is as it seems. Applications ask for ridiculous amounts of storage, and users expect them to work. It's only when data is actually written to a page that anyone starts to care.
For example, on my latop: /proc/meminfo/
VmallocTotal: 34359738367 kB

I wish ...
 
  


Reply



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
ps aux and top graziano1968 Linux - Server 1 11-30-2007 09:58 AM
LXer: Tiny Tiny RSS: A very very useful RSS reader LXer Syndicated Linux News 0 05-16-2007 02:46 AM
one username in ps -aux not resolving FliesLikeABrick Linux - Software 1 01-17-2007 05:20 PM
problem with syntax in ps -aux alaios Linux - General 2 09-30-2006 07:34 AM
LXer: Expand RSS Capabilities with RSS Extensions LXer Syndicated Linux News 0 08-22-2006 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:23 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration