Re: mempools conversions, more ..

From: Adrian Chadd <adrian@dont-contact.us>
Date: Fri, 6 Oct 2000 04:29:15 +0800

On Thu, Oct 05, 2000, Alex Rousskov wrote:
> On Thu, 5 Oct 2000, Adrian Chadd wrote:
>
> > .. ok. Whilst I'm flying SYD->AMS over the next day or two, can I please
> > spark some conversation as to whether converting everything that can
> > immediately use a mempool to use one? I personally think this is a *GOOD*
> > idea. If noone can convince me otherwise then I'll go ahead and start
> > chopping things up and making them mempool'ed when I get back into Amsterdam
> > over the course of the next week.
>
> IMHO, converting everything that has a known constant size to mempools
> is reasonable. While it makes sense mostly for debugging purposes
> (tracing memory leaks and general profiling), the overhead is minimal.
> We can also hope that memory thrashing will be reduced.

Well, I'm also hoping that once things are mempool'ed, the mempool allocator
can be "optimised" to pre-allocate chunks of things rather than how its
done right now.

> The only thing I would be careful about is pools for objects allocated
> in high volumes at some stage of Squid operation and then freed with no
> consecutive reuse. The pools for those objects still make sense (for all
> the same reasons). However, the idle limit for those pools should be set
> to a very small value (say, zero) to avoid wasting memory.

Thats right.

> IMO, strings (non just any variable size buffer!) should be allocated
> with the buffer size stored in the first two bytes of the string. This
> way, we do not have to remember which pool was used for the string. I
> may be thinking some other program, but I think there was a String class
> in Squid that can be trained to do that (if not already).

.. if only C used pascal strings rather than NUL-terminated strings, life
would be a whole lot easier. I haven't checked out the string code just
yet, I was planning on going through and MemPool'ing the obvious suspects
before I run off and do the harder things.

Andreas, you're doing malloc stuff right now. How many malloc/sec at
a given request rate are you seeing on average?

Adrian

-- 
Adrian Chadd			"If a butterfly flaps its wings in China,
<adrian@creative.net.au>	    will a woman get naked in Amsterdam?"
				      -- Ashley Penney on Chaos Theory
Received on Thu Oct 05 2000 - 14:29:21 MDT

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