I have to disagree.
From http://perl.apache.org/docs/1.0/guide/performance.html#toc_Memory_leakage
--
Memory leakage
Scripts under mod_perl can very easily leak memory! Global variables stay around indefinitely, lexically scoped variables (declared with my()) are destroyed when they go out of scope, provided there are no references to them from outside that scope.
Perl doesn't return the memory it acquired from the kernel. It does reuse it though!
--
The last line does imply that you shouldn't do things like slurp a 100MB file into a my() var, because even though it will be freed, that 100MB is only available to Perl and won't go back to the OS. However, it's not as bad as if my() vars were never freed automatically. If that were the case, nearly every mod_perl application out there would eventually use up all available memory (without Apache::SizeLimit coming to the rescue). | [reply] |
| [reply] |