perl 5.8 and malloc (and mod_perl)

Mike Harding mvh at ix.netcom.com
Thu Jan 15 15:31:39 PST 2004


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

The situation looks similar to:

http://perl.apache.org/docs/1.0/guide/install.html#When_DSO_can_be_Used

(although not exactly the same) and I found by rebuilding perl with
the system malloc as follows

# make -DWITHOUT_PERL_MALLOC

and rebuilding mod_perl (not sure if I needed to do that) the leak
stops, or at least slows down so much that I don't care.

You might want to consider moving the malloc switch the other way, or
at least putting a big fat warning on the perl build so that others
don't have to jump through the same hoops that I did...

Thanks for working on the port...

- Mike H.



More information about the freebsd-ports mailing list