[Zope] Zope Eating Memory for Breakfast

Bill Anderson bill@libc.org
Thu, 13 Apr 2000 14:31:29 -0600


Hung Jung Lu wrote:
> 
> Hi Bill,
> 
> Here is the report from my camp. I use "top", which is not
> the same "top" that you use. In fact, our "top" here DOES
> calculate memory usage and the first few lines are IDENTICAL
> to the results given by "free".
> 
> Could you post a feedback on your interpretation of this
> information?
> 
> Hung Jung
> 
> ==============================================================
> result from "free":
> 
>              total       used       free     shared    buffers     cached
> Mem:        257624     254304       3320      47632     161828      10868
> -/+ buffers/cache:      81608     176016
> Swap:       265032       1288     263744
> 
> ==============================================================


The entire amount of memory currently in us eon this machine is 81608K,
or roughly 82 MB.

At one time, you had dipped into swap for about 1.2MB.
(swap for some reason tends to keep the total amount used at a given
time, as opposed to current swapping activity, if any.)

> result from "top"
> 
>   9:29am  up 7 days, 20:01,  1 user,  load average: 0.00, 0.00, 0.00
> 59 processes: 58 sleeping, 1 running, 0 zombie, 0 stopped
> CPU states:  0.0% user,  0.7% system,  0.0% nice, 99.2% idle
> Mem:  257624K av, 254444K used,   3180K free,  48116K shrd, 161924K buff
> Swap: 265032K av,   1288K used, 263744K free                 10804K cached
Counting buffers, shared, cached, and active memory use, you have used 
254444K of memory. Currently you are using (actively): 
 254444K (total)
 161924K (buffered)
- 10804K (cached)
========
  81716K (active)

Note that the +/- field in free does this for you. :)
Also, you can likely pass the -m option to free, and it will display in
MB. :)

> 
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
> 25678 nobody     0   0 32320  31M  2224 S       0  0.0 12.5   0:32 python
> 25679 nobody     0   0 32320  31M  2224 S       0  0.0 12.5   0:00 python
> 25680 nobody     0   0 32320  31M  2224 S       0  0.0 12.5  10:09 python
> 25681 nobody     0   0 32320  31M  2224 S       0  0.0 12.5  11:43 python
> .....

python usage of memory: 31MB _total_ not per-thread, which would be
124MB.
As you can see, since you are only using ~80MB total (active), you
couldn't possibly be using 124MB. :)

Each thread is using ~2Mb of shared memory.

Looks like the same top. it displays them, but doesn;t calulate the
actual usages for you.

Also:
The SIZE and RSS fields don't count the page tables and the task_struct
of a process; this is at least 12K of memory that is always resident. 
SIZE is the virtual size  of the process (code+data+stack).




-- 
In flying I have learned that carelessness and overconfidence are 
usually far more dangerous than deliberately accepted risks. 
          -- Wilbur Wright in a letter to his father, September 1900