Re: Squid-2.4 memory leaks

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 12 Oct 2001 21:13:32 +0200

Andres Kroonmaa wrote:

> dlmalloc is ok, there is nothing any heap malloc can actually do if
> something in squid is using up huge parts of memory, then releasing it
> but leaving some small bits in use in high mem.

More to it than only that.

> But I can't imagine anything in squid that wouldn't fit into 900MB of
> free space because of fragmentation...

Exacly.

> Really sounds like he is using broken malloc implementation, what we
> can't say about dlmalloc...
> Notice, that process size has never shrunk, which it definitely should
> have at least once during a day.

Depends heavily on the malloc implementation.

What can be said is that when there is 600MB of free memory, there MUST
be suitable free memory for all types of allocations done by Squid, or
the malloc implementation is extremely bad.

> What I can think of, is hypotetically this usage pattern:
> - request buffer grows very big, over mempool size, it is realloc()ed,
> - StoreMemBuffer is taken from heap, sticking into ram beyond reqbuf,
> - after reqbuffer is freed, hole is created in freemem.
> - this hole is being filled, partially fragmenting it.
> - new realloc can't fit into fragmented freemem, so it allocs new space.
> ... etc.

Even then, what is seen by Florin is quite extreme.

Regards
Henrik
Received on Fri Oct 12 2001 - 13:13:16 MDT

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