manu@... wrote:
> Oliver Fromme wrote:
> > I noticed that the memory handling (malloc()/free()) of
> > milter-greylist is a pretty tough test for the system's
> > malloc implementation.
>
> Wow. I never expected the legitimate use of malloc() and free() to be a
> torture test for the system's libc. I'm a bit shocked to hear that it
> can cause troubes.
It should not cause any trouble. But the efficiency depends
on the respective malloc implementation. Some of them are
optimized for speed, but can lead to "memory fragmentation"
if a programm uses a lot of malloc+free (or realloc) with
varying sizes (which milter-greylist does, AFAIK). Others
are optimized for avoiding such fragmentation, but at the
cost of speed.
That means that milter-greylist can exhibit very different
memory behaviour on different platforms. E.g. its memory
consumption might be moderate on one platform, while it
grows considerably larger on another platform, even if it's
under the same load and has the same number of entries in
its greylist. Even on the same platform, the behavious can
be different. As Chris Hoogendyk explained, Solaris seems
to offer three different malloc implementations. FreeBSD
got an alternative one recently, and both of them are
configurable (globally via /etc/malloc.con, and per-process
via an environment variable).
Bottom line: As a programmer, you should not need to care
about a system's malloc efficiency. Just try to trust it.
Well, there are certain ways to assist malloc() doing a
more efficient job, e.g. by allocating larger chunks of
memory and subdividing them yourself, so you have to call
malloc or realloc less often. But it's difficult to say
whether that's really worth the effort.
Best regards
Oliver
PS: There's no reason to be shocked. :-)
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"Being really good at C++ is like being really good
at using rocks to sharpen sticks."
-- Thant TessmanMessage
Re: [milter-greylist] [Fwd: watch-greylist]
2006-08-03 by Oliver Fromme
Attachments
- No local attachments were found for this message.