Re: Memory Footprint claims

I have an answer.  People do not understand ps output.

You need to take into account all of /proc/meminfo before drawing
conclussions, here is a document that explains things:

Understanding Memory usage in GNOME.
Miguel de Icaza (

People usually look at the memory sizes for the processes and
misinterpret the information.  This is a common mistake people do.

When talking about memory usage and the reports you get from the
operating system, you need to keep in mind the following terms and
what they mean:

	SIZE	This is the address space seen by the process.  If the
	        process maps 65 megs of memory, the address space of
	        the process will be reported as 65 megs of memory. 

		Even if only 100k of memory are actually used.  
	 	This bit of information is not usually very useful and
	        this is what most people believe is the actual memory
	        usage of a program: it is not.

	RSS	This is the "Resident Set Size".  This is the amount
	        of memory actually resident on memory.  This is a
	        better computation of what is actually loaded in

	  	This does not include any piece of code that have been
	        "swapped out".

		So, for example, if you have a program that uses 100k
	        of memory and the operating system discards or swaps
	        40k of memory, the RSS will be 60k.

		The RSS includes both the memory which is unique to
	        this process and the memory shared with other
	        processes.  In most modern Unix systems, a large part
	        of this accounts for the memory used by shared
	        libraries.  So it usually includes the ammount of
	        memory that is used by other processes for the code
	        that is shared:  The libc is usually taken into

		GNOME uses many shared libraries (this makes the
	        applications share more memory).

	SHARE   This is the amount of memory from the RSS that is
	        used by the application.  

So, the actual memory used uniquely by an application is RSS-SHARE.
If two programs use library "A", then the process would also be
"responsible" for A/2 of the memory, but there are many variations
(which pieces of the library each program uses) that make this
computation hard.

A good approximation is thus "RSS-SHARE".

The file manager in GNOME for example uses the following libraries: 

CORBA libraries: => /opt/gnome/lib/ (0x40007000) =>/opt/gnome/lib/ (0x40011000) => /opt/gnome/lib/ (0x4001a000) => /opt/gnome/lib/ (0x4007c000) => /opt/gnome/lib/

GNOME graphiacl libraries: => /opt/gnome/lib/ => /opt/gnome/lib/ => /opt/gnome/lib/

Session management libraries: => /usr/X11R6/lib/ (0x4016a000) => /usr/X11R6/lib/ (0x40173000)

GTK libraries: => /usr/local/lib/ (0x40188000) => /usr/local/lib/ (0x402a3000)

Glib libraries: => /usr/local/lib/ => /usr/local/lib/

X11 libraires: => /usr/X11R6/lib/ (0x402d9000) => /usr/X11R6/lib/ (0x402e7000)

GNOME libraries: => /usr/lib/ (0x404a4000) => /opt/gnome/lib/ (0x403a3000) => /opt/gnome/lib/ => /lib/ (0x403bb000)

Standard Unix libraries: => /lib/ (0x403ea000) => /lib/ (0x4038a000) => /lib/ (0x403ff000)
        /lib/ => /lib/ (0x2aaaa000)

File manager libraries: => /lib/ (0x403ed000) => /lib/ (0x403fd000)

So, even if it does not use all of the code, the "SIZE" will reflect
the maximal size the program would be using if it used all of those

The more libraries we use the bigger the SIZE goes, even if this does
not reflect the actual memory usage.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]