HUGE Virtual Memory Usage

Jan Morén jan.moren at lucs.lu.se
Thu Oct 6 22:33:06 UTC 2005


tor 2005-10-06 klockan 12:34 -0400 skrev Matt Patterson:
> I assumed it had to be something like that. Thanks for the info. Is
> the "Resident Memory" section also a shared measurement? It seems like
> a much more realistic value for each app (10's of megs). 
> 
> Another question: If using a shared library requires it to be loaded
> into ram, and that means huge ram usage as I am seeing because the
> modules are large, would it not be more memory efficient (I know it
> wastes hard disk space) to simply statically link apps instead of
> dynamically. Then apps wouldnt have dependency issues and they would
> only load the necessary routines into memory? Of course there would be
> redundancy in memory because each app could load the same functions,
> but still.

As far as I know, a shared library will always be more efficient than
static linking as soon as more than one app is using it. The entire
shared library isn't pulled into memory either, only the pieces that
actually get used. 

> 
> 
> James Livingston wrote: 
> > On Thu, 2005-10-06 at 11:37 -0400, Matt Patterson wrote:
> >   
> > > I was just wondering if this is a normal thing. I have a machine with 
> > > 768 megs ram, but the VM numbers given by System Monitor seem 
> > > outrageous. Right now in the VM column I see:
> > > 
> > > firefox-bin    232.1 mb
> > > soffice.bin    208.8 mb
> > > nautilus         176.7 mb
> > > gnome-vfs-daemon   52.7 mb
> > > gnome-terminal      50.7 mb
> > > X     220.4 mb
> > > mozilla-thunderbird   152.2 mb
> > > vmware-vmx   317.3
> > >     
> > 
> > The VM size of an application isn't how much memory it is using, it is
> > the size of it's address space. What this means is that the size of a
> > shared library will be included in the VM size of every application that
> > uses it, even though there will only be one copy in memory.
> > 
> > On okay approximation of "how much memory is an app using" is (RSS -
> > Shared). That isn't an exact figure, because it's hard to define exactly
> > what is meant by "how much memory is an app using?".
> > 
> > 
> > Cheers,
> > 
> > James "Doc" Livingston
> >   
> 
-- 
Tel. (Japan) 090-3622 8920            Dr. Jan Morén (mr)
Sweden: +46-31 360 7723               Dept. of Cognitive Science
http://lucs.lu.se/people/jan.moren    Lund, Sweden





More information about the ubuntu-users mailing list