memory leaks in perl

Stewart C. Russell scruss-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org
Sat May 1 12:39:16 UTC 2004


Sergey Kuznetsov wrote:
> 
>     If random, probably you are not cleaning unused hash entries, 

It's probably best not to second-guess Perl's memory management. Freeing 
up hash entries would only return memory to the process's heap, not free 
it for other programs to use.

>     undef $hash{$key}

That wouldn't work. That's the same as saying $hash{key} = undef -- it's 
setting the value to undef, not freeing up the key.

I'd recommend the OP look at:

* searching for 'leak' on perlmonks.org (you *do* do perlmonks, yes?)

* install Devel::Leak, which spits out stuff to stderr whenever a leak 
happens.

  Stewart
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list