Re: Chunked memory allocator

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Fri, 28 May 2010 11:21:20 +0200

fre 2010-05-28 klockan 17:08 +1200 skrev Amos Jeffries:

> Right now in light of the issues that keep cropping up my vote for
> squid-3.1 is for (a). Dropping of the impossible settings in squid.conf,
> with real default-disabled mempools. Plus some clear documentation of
> the environment variable to turn them on. Or would it be better to make
> it a command-line option for startup?

Not what I meant by 'a', but obviously also is an alternative

c) Change the pools to default fully off and hidden away, requiring an
environment variable to be set to enable.

It's currently not possible using a command line option as the pools are
set up before main() starts, which is another thing we should change to
not have active initialization in static constructors, only module
registration, and leave initialization to main().

> On other slightly related memory issues... some users who need good
> malloc have been trying to build squid with talloc or the google malloc
> implementation. I'd like to see such alternative allocators easy to
> plug in. If it already is that way then we lack documentation about how
> to do it.

Properly using talloc could bring some interesting effects, but that's
another project in itself. tallock !== a malloc replacement, instead
talloc uses a slightly different approach to memory management.

Google malloc should plug right in as a malloc replacement by just
adding -ltcmalloc or by using LD_PRELOAD when starting the binary. And
it's design practically eliminates heap fragmentation. With tcmalloc
(google-perftools) already packaged for a number of distributions this
should be an easy switch.

Regards
Henrik
Received on Fri May 28 2010 - 09:21:29 MDT

This archive was generated by hypermail 2.2.0 : Sat May 29 2010 - 12:00:12 MDT