Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-23-2005, 03:49 PM   #1
LQ Newbie
Registered: Sep 2005
Posts: 2

Rep: Reputation: 0
Reported memory use

In windows, program A takes up 10 MB of RAM and 27 MB of virtual memory. The RSS/Size value in Linux for program A is 37 MB. This adds up. The man page for PS in Linux says "SIZE is the virtual size of the proc (code+data+stack)". What exactly does this mean?
Old 09-23-2005, 04:51 PM   #2
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
When a process is created in linux an area of memory is mapped for said process. The memory consists of the amount of space for the program itself (aka the code), the heap (aka the data), and the stack (where the local variables for a single procedure and return values and such get stored). This is all "virtual" address space. It is not necessarily contiguous in memory and might not reside in actual physical memory. The other thing you have to be aware of.... if a program dynamically allocates a large piece of memory and frees it you might not see an immediate reduction in the total memory usage for the process. Linux takes the "lazy" approach to freeing memory. When you free memory it makes a note that it is free but doesn't actually do anything about it until something else needs that memory.

It is hard to get more specific without going into an amount of detail you probably don't care to know.
Old 09-24-2005, 12:19 AM   #3
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
yes many windows users come to Linux very confused about memory
often believing the resident set is the set of pages that are resident in physical memory.
this was actually true back in the day before cpus had memory manageament units i think.
It's understandable because winblows and how it works is a secret,
as jtshaw so correctly pointed out
RSS is
The total virtual memory size of the process mapped pages , including any memmapped files and/or devices being mapped to the proccess.
it is even possible for you the Linux user to increase the basic page size of your memory and insrease performance by reducing the size of the arrays actually resident in memory used to keep track of the pages themselves. You would then see larger memory use numbers and subsequent better performance.
so you just have to give up on legacy 1983 windows concepts


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
incorrect memory size reported tintapok Slackware 3 10-29-2005 02:11 AM
Memory reported less than installed (Mandrake 10) vo24 Linux - Hardware 17 03-29-2005 04:02 PM
Maximum memory reported by /proc/meminfo in vanilla 2.4.26 kobica Linux - General 0 11-15-2004 06:49 AM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 05:48 PM
Memory usage reported using TOP Kdiver58 Linux - Newbie 1 02-03-2003 02:31 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:45 AM.

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