http://qs1969.pair.com?node_id=75027


in reply to Re: MemLeak in Perl from C Calls
in thread MemLeak in Perl from C Calls

Hi kal,
first: thanks for your efforts!

I tried this and the leak became invisible. But then I found that if you'd take away the sleep(1) it still grows.
As a matter of fact: with the perl interpreter intitialising stuffed into main it grows only every 30 calls or something like that -> ?!?!

Just to be sure I removed the call_perl()-statement from the loop and it didn't leak...

Regards Stefan K

Replies are listed 'Best First'.
Re: Re: Re: MemLeak in Perl from C Calls
by SilverB1rd (Scribe) on Apr 24, 2001 at 17:58 UTC
    Just a stab in the dark but why not fork a child to do you loop? After you are down with the loop the child ends and should not the memory be reclaimed?

    ------
    The Price of Freedom is Eternal Vigilance
      Good point ...
      BUT only for this cooked down example. We actually need to get data from that perl call back into the main program. That is database access via DBI, reading (and parsing ;-) of text-files, evaluating perl code that gets some configuration etc....

      Regards Stefan K