in reply to Memory usage of a "sub" in mod_perl

The operative question is:   does the memory consumption keep growing?

If it does, then you probably have a circular-loop or something similar that is preventing garbage collection.

But remember... a computer is lazy. (Lazier, in fact, than a good Perl programmer, if such a thing is possible...) It's not going to reduce the working-set size of a process unless there is actual competition for the storage-resource. There's no value, after all, in reclaiming a virtual-memory page that's going to incur a page-fault a few milliseconds later...