Virtual Memory gone mad

Sharpe, Sam J sam.sharpe+lists.redhat at gmail.com
Tue Mar 10 22:15:00 UTC 2009


2009/3/10 Jonathan Ryshpan <jonrysh at pacbell.net>:
> Investigating why my computer had suddenly become very s.l.o.w, I
> noticed that virtual memory usage had become very large.  Following is
> an extract from a "$ ps axuw" for the system sorted according to VM
> usage, the top 20 processes in VM usage.  Does anyone know why evolution
> + evolution evolution-data-server use not quite 2 GBytes?  Or why the
> ordinary applets use together 1.4 GBytes?  Or why sealert uses about 0.5
> GBytes?  Or anything else on this list?
>
>  PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> 2656  1.2  5.2 1668576 53708 ?       Sl   12:20   1:26 evolution
> 2662  0.0  0.2  444628  2680 ?       S    12:20   0:00 /usr/bin/python -E /usr/bin/sealert -s

You can't add up the VSZ sizes of processes and arrive at a simple
sum, because you don't have enough information.

Program 1 links to library A and uses shared memory B
  => VSZ1 = SizeOf(1) + SizeOf(A) + SizeOf(B)
Program 2 also links to library A and uses shared memory B
  => VSZ2 = SizeOf(2) + SizeOf(A) + SizeOf(B)

So you'd think that the total memory in use would be VSZ1+VSZ2,
but each library is only in memory once so in actual fact it's only
VSZ1+SizeOf(2).

To look at it another way, say you have 1000 processes running using
1kb, each linking in a different library of 1kb. The VSZ of each of
them would only be 2kb. You then have an additional process using 1kb
running, that links in *all* of the 1000 libraries already in memory.
It's VSZ would be 1001kb, even though it's actually only using 1kb
more of memory.

But yes, Evolution is a memory hog ;o)

-- 
Sam




More information about the fedora-list mailing list