On Tue, 2006-08-15 at 13:25 -0700, Arshavir Grigorian wrote:
> I guess I was more interested in type of structures that continuously
> increase the memory footprint with each request (memory leaks).
> Barring a database table getting larger, etc, is there any reason why
> the memory footprint should grow with each request (for the same page,
> obviously) ?


There used to be some bugs with code refs that would do this, but I
think they're all fixed in recent versions of Perl. Aside from that, it
would mostly be obvious things: continuously adding to some array or
hash that never goes out of scope maybe. There could be a variable that
you accidentally made into a closure var. Most of the time when I found
one of these it was the code ref bug, as seen when using Error.pm or
other modules that take code refs.

> Interesting ... I thought once a variable went out of scope, its
> memory would be available for other uses within the same Perl process.
> So would you recommend undef-ing all variables that store large data chunks?


If you know you the variable will be rarely used it could be good. If
it's being used frequently, it will just need the memory again next
time.

- Perrin