develooper Front page | perl.perl5.porters | Postings from September 2003

Re: [perl #24061] shared array memory leak in 5.8.1

From:
Enache Adrian
Date:
September 29, 2003 10:19
Subject:
Re: [perl #24061] shared array memory leak in 5.8.1
Message ID:
20030929171622.GA1398@ratsnest.hole
On Mon, Sep 29, 2003 a.d., Dave Mitchell wrote:
> On Sun, Sep 28, 2003 at 04:27:36PM -0000, Eric Garland wrote:
> > This program will make perl 5.8.1 expand to using 350 mb on my linux 
> > machine within 60 seconds: 
> > 
> > 
> > use threads;
> > use threads::shared;
> > my @shared : shared;
> > @shared = (1) while (1);
> 
> It's leaking 1 shared-interpreter SV per iteration. Not sure what the SV
> is yet. May not have time to investigate further.

Look at ext/threads/shared/shared.xs - sharedsv_elem_mg_STORE().
The svp got with 'av_fetch(..,1)' has its refcnt incremented from 1 to 2
by Perl_sharedsv_associate(). When the array is cleared, it won't be
freed.

Have fun,
Adi



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About