On Thu, 7 Dec 2000, Ivan E. Panchenko wrote:
> Today I discovered a strange behaiviour of perl, 
> and I wonder if anybody can tell me what to do with it.
> 
> The matter is that perl DOES NOT REUSE MEMORY allocated for 
> intermediate calculation results. This is specially harmful to
> data-intensive modperl applications where one perl process processes
> many queries and can leak great amount of memory.

This is known and it's not really a leak.  Perl knows about that memory
and does re-use it, the next time it needs that lexical variable.  It's a
performance optimization.  Try running your code multiple times and you
should see memory stay at the same level after the first run. 

There has been discussion about this on the mailing list which you can
find in the archives.  There has also been talk about changing this
behavior for mod_perl 2, which Doug is working on.

Anyway, if you just want the memory back, undef your lexicals after you
finish with them.

- Perrin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to