Re: Possible memory leak in 2.3stable2?????

From: Chris Dillon <cdillon@dont-contact.us>
Date: Sat, 18 Mar 2000 23:29:22 -0600 (CST)

On Sat, 18 Mar 2000, BJ Peterson wrote:

> Hello,
>
> I have Squid 2.3stable2 installed on a Mac OS X 1.2 Server (BSD 4.4). I
> have the "cache_mem" in the squid.conf file set to 128mb (the server has
> 512mb installed). I have been having some crashing problems (runs fine
> for a day or two), so I watched the squid process with top for the
> better part of a day, and I saw the squid proccess go from using around
> 100mb to using over 300mb (well above where I have the "cache_mem" set;
> I assume that if I let it keep going the machine will run out of memory,
> thus causing a crash). I shutdown the squid proccess and wait 2 to 3
> minutes, then, after top says the memory has cleared, I restart squid.
> Then it's memory usage is acceptable again, but as the day goes on, it
> climbs well beyond what I have "cache_mem" set at again.
>
> Does anyone have any suggestions/solutions?

You misunderstand what cache_mem does. It doesn't limit Squid's
overall memory size, but only sets the soft-maximum amount of memory
to be used for hot, in-transit, and negatively cached objects. It
says this in nice all-capital letters in the cache_mem section in the
default config file. :-) I increased mine from the default 8MB to
only 16MB. It would be a good idea to have this at least a few MB
bigger than your maximum_object_size so not all objects get thrown out
when someone requests a large file.

I've found that on my x86 based system running FreeBSD 3.4, Squid
requires about 10MB of RAM for every 1GB of on-disk cache. Shortly
after starting Squid and being hit by at least a few hundred requests,
it stays at around 200MB with my full 20GB cache. A cache with many
small objects will require more memory than the same size cache with
fewer large objects, but I think my average object size is more or
less the norm. Squid could quite possibly also require more memory on
a RISC system such as you're running, but I'm not sure.

-- Chris Dillon - cdillon@wolves.k12.mo.us - cdillon@inter-linc.net
   FreeBSD: The fastest and most stable server OS on the planet.
   For Intel x86 and Alpha architectures. ( http://www.freebsd.org )
Received on Sat Mar 18 2000 - 22:32:47 MST

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