perl 5.8 and malloc (and mod_perl)

Alexander Leidinger Alexander at
Fri Jan 16 03:29:00 PST 2004

On Thu, 15 Jan 2004 15:31:28 -0800 (PST)
Mike Harding <mvh at> wrote:

> (This is a copy of a mail already sent to the perl5.8 port maintainer,
> I wanted to make sure that this info is available to those who run
> into the same issue)
> I have a few client sites where recently (since a perl upgrade)
> Mason/mod_perl based httpd processes had 'swollen' to huge sizes -
> 300+ meg.  After a lot of coffee and googling and such, it looks like
> the culprit is somehow related to the use of perl's malloc.  When
> apache gets a graceful restart signal (for rotating logs) the root
> apache process (and all it's children) grow by 6 megs or so.  I'm
> rotating the logs every day at midnight so it took a while for me to
> notice.

I don't know if the situation changed with perl 5.8, but with 5.6 you
have to compile with perls malloc if your application makes use of
signals, else you will see heisenbugs. It isn't safe to call malloc in a
signal handler -- see sigaction(2) -- and a perl program which makes
use of signals may just do this.


           I will be available to get hired in April 2004.                       Alexander @
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7

More information about the freebsd-ports mailing list