in reply to Re^4: 2 Questions on Images and Mod_perl mem usage
in thread 2 Questions on Images and Mod_perl mem usage
To answer your root question, no globals won't gain you anything. Perl's memory usage is sort of a high water marker. It asks for memory from the OS when it needs some, then reuses what it got. In your little subroutine example, perl will allocate space for the lexical, free it when it went out of scope, use the same memory for the next lexical, and so on. 8.5mb for a perl process doesn't seem all that high, but perhaps you're doing something like loading a large file in to memory that you could avoid.