> You're probably doing something that is causing certain variables to have
> temporarily large values.  As always, start with the guide:
>
> http://perl.apache.org/guide/performance.html#Memory_leakage
>
> You should also make sure you're doing the usual pre-loading and other  
> suggestions from this section of the guide.  You may find the section in
> the camel book on optimizing for size useful as well.
>
> -Perrin

The issue of growing (but never shrinking) processes comes up frequently.
I saw a nice explanation of why perl can not return memory no longer
needed in the Perl Cookbook:

<quote>
Freed memory is returned to Perl for later use, but few operating systems
reclaim it and decrease the process's memory footprint. This is because
most memory allocators use a stack, and if you free up memory in the
middle of the stack, the operating system can't take it back without
moving the rest of the allocated memory around. That would destroy the
integrity of your pointers and blow XS code out of the water.
</quote>

http://www.oreilly.com/catalog/cookbook/


Slightly related:  Is it possible/desirable to have to have perl allocate
memory in a certain range?  Perhaps within a previously allocated shared
mem area?  Assuming you delt with the locking issues, it seems that you
could share one "scratch" space among a number of processes.

-Tim




Reply via email to