Re: mempools conversions, more ..

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Thu, 5 Oct 2000 07:58:22 -0600 (MDT)

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.

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.

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).

Alex.
Received on Thu Oct 05 2000 - 14:25:59 MDT

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