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

[perl #22121] memory leaking in perl_destruct and perl_free ?

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
September 27, 2012 19:07
Subject:
[perl #22121] memory leaking in perl_destruct and perl_free ?
Message ID:
rt-3.6.HEAD-11172-1348798016-926.22121-15-0@perl.org
On Tue Aug 05 18:16:54 2003, Haili.Ma@netiq.com wrote:
> Keep creating new perl interpreter and freeing it always causes me
leaking.
> The way I used is that creating perl interpreter once, save it and use it
> next time.
> 
> -----Original Message-----
> From: Radu Greab [mailto:perlbug-followup@perl.org]
> Sent: Tuesday, August 05, 2003 3:26 PM
> To: Haili.Ma@netiq.com
> Subject: Re: Embedded memory problem [perl #22121]
> 
> 
> "Widgery, Tom" wrote:
> > This seems to cause a rather large memory leak - I have traced through
> this
> > line by line and can see that the perl_parse obtains a large amount of
> > memory but the perl_free doesn't seem to release any of it.
> > 
> > My question is:  Is there anyway to fix this issue? Unfortunately if we
> > can't find a way to release this memory I am going to have to re-write
> > everything using another language!!!
> 
> Please try your code with a perl configured with -Dusemultiplicity.
> Teoretically you should have few or no leaks.
> 
> If you can't configure and use perl with -Dusemultiplicity, then check
> perlembed(1) and perlhack(1) for the meaning of PL_perl_destruct_level
> interpreter variable and PERL_DESTRUCT_LEVEL environment variable. The
> example from perlembed.pod should be:
> 
>  while(1) {
>      ...
>      /* reset global variables here with PL_perl_destruct_level = 1 */
>      PL_perl_destruct_level = 1;
>      perl_construct(my_perl);
>      ...
>      /* clean and reset _everything_ during perl_destruct */
>      PL_perl_destruct_level = 1;
>      perl_destruct(my_perl);
>      perl_free(my_perl);
>      ...
>      /* let's go do it again! */
>  }
> 
> 


This ticket has been languishing for many years.  It would benefit from
the attention of anyone good at dealing with memory leak issues or at
embedding Perl in C.

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=22121

Thread Previous | Thread Next


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