Re: memory watermarks ?

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 26 Oct 2000 20:23:59 +0200

On 27 Oct 2000, at 1:45, Adrian Chadd <adrian@creative.net.au> wrote:

> > PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
> > 30946 squid 9 0 39400 37M 1076 S 0.0 40.2 2:34 squid
> > 30951 squid 9 0 39400 37M 1076 S 0.0 40.2 0:00 squid

 threads on linux?

> > [root@tornado squid]# ps -auxw | less
> > USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> > squid 30951 0.0 40.2 74364 38256 ? S Oct22 0:00 (squid) -D -S

> How bizarre... :
>
> Memory usage for squid via mallinfo():
> Total space in arena: 39449 KB
> Ordinary blocks: 39442 KB 5 blks

> Total in use: 39618 KB 100%
> Total free: 6 KB 0%
> Memory accounted for:
> Total accounted: 16695 KB

> Hrm. Anyone got any ideas?

 if I understand right, then VM size and space in arena should match.
 As they don't then either system or mallinfo is lying.

 Maybe some system libs are using memory in a way that malloc lib cannot
 account for, and are leaking.
 Each thread has its own stack, typically 1M per thread. 30 threads may
 count for 30M of VM.
 Maybe ps and top are summing differently: shared mem is 1M per PID,
 maybe top is counting this once, and ps for each thread?

 Squid's own leaks should be reflected in mallinfo, I believe.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu Oct 26 2000 - 12:27:03 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:52 MST