Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: No garbage collection for my-variables

by repellent (Priest)
on Sep 16, 2008 at 02:31 UTC ( [id://711591]=note: print w/replies, xml ) Need Help??


in reply to No garbage collection for my-variables

Another workaround is to re-exec the program, as outlined in:

How can I free an array or hash so my program shrinks?
  • Comment on Re: No garbage collection for my-variables

Replies are listed 'Best First'.
Re^2: No garbage collection for my-variables (exec code)
by tye (Sage) on Sep 16, 2008 at 04:16 UTC

    Hmm, that FAQ answer could do with some code:

    exec( $^X, $0, @ARGV ) or die "Can't execute self so killing self: $!\n";

    - tye        

      Nice!

      Also remember: don't shift your @ARGV ;-)

      But seriously, wouldn't it be more involved since we need to consider saving the program "state" and resume it somehow?
        But seriously, wouldn't it be more involved since we need to consider saving the program "state" and resume it somehow?

        Not always. In fact, quite often, if you do the exec when you aren't in the middle of something, that is all the code you need. Servers usually process transactions and it is usually a bad idea to have your stuff break because critical data is stored nowhere other than the memory of some service.

        - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://711591]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-23 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found