Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2004 00:45:15 -0600
From:      "Brandon D. Valentine" <brandon@dvalentine.com>
To:        "Bakken, Luke" <Luke.Bakken@getronics.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: perl 5.8.2 memory leak?
Message-ID:  <20040122064515.GK10936@geekpunk.net>
In-Reply-To: <407DF7D68DD30440B5CEB70ED234D1CF04764B5D@excuswa100.americas.unity>
References:  <407DF7D68DD30440B5CEB70ED234D1CF04764B5D@excuswa100.americas.unity>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 21, 2004 at 06:22:00PM -0800, Bakken, Luke wrote:
>
> One difference I did note is in the output of perl -V:
> 
> 5.6.1 -> usemymalloc -> 'n'
> 5.8.2 -> usemymalloc -> 'y'

The perl5 and perl5.8 ports both have a WITH_PERL_MALLOC option.  If
this option is defined then the port uses Perl's malloc (usemymalloc=y),
if it's undefined it uses the system malloc (usemymalloc=n).  In
lang/perl5.8 the default is to use Perl's malloc unless WITH_THREADS is
defined, in which case it falls back to using the system malloc.  In
lang/perl5 the default is to use the system malloc.  I am uncertain why
the defaults are set differently between the two versions of Perl.
Perhaps the Perl maintainer could shed some more light on that.  At any
rate if you build lang/perl5.8 with WITHOUT_PERL_MALLOC defined you can
test your theory that the Perl malloc is the cause of your memory leak.  

[ For future reference, everything I told you above could have been
divined from a glance at the relevant port Makefiles. ]

Your code could be exposing a bug in the Perl malloc implementation.
You should also consider the possibility that your code or one of the
modules you are making use of is the cause of the memory leak and
perhaps the Perl malloc implementation merely exacerbates the problem.
At any rate the best way to find out is to create the simplest possible
example program which triggers the bug.  Take that program and run it
through a Perl interpreter on FreeBSD using both the Perl malloc and the
system malloc and then do the same on a Linux machine and compare.  If
you do this, please take that information and file an upstream bug
report against Perl.

HTH,

Brandon D. Valentine
-- 
brandon@dvalentine.com                           http://www.geekpunk.net
Pseudo-Random Googlism:  truth is relative einstein's theory may have to
                         be turned on its head



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040122064515.GK10936>