in reply to Force perl to release memory back to the operating system

fork()ing will not release memory, yes. But think about this:
@ARGV = ('--restart', Data::Dumper::Dumper(\%whatever)); exec( $^X, $0, @ARGV ); RESUME: #only if you really need to!
and at the beginning of your program:
if ($ARV[0] eq '--restart') { %whatever = %{ eval $ARGV[1] }; goto RESUME; #only if you really need to! }
Or you can use a temporary file to store your variables. There is not that much space in @ARGV...

Replies are listed 'Best First'.
Re: Re: Force perl to release memory back to the operating system
by Roger (Parson) on Sep 25, 2003 at 12:09 UTC
    This looks like a great technique! I will keep that in mind tomorrow when I am back at the office. Even if I am not going to do this in my current project, I will certainly try it out later!