Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Perl and memory usage. Can it be released?

by sundialsvc4 (Abbot)
on Feb 07, 2014 at 17:49 UTC ( #1073907=note: print w/replies, xml ) Need Help??


in reply to Perl and memory usage. Can it be released?

Well, this absolutely qualifies as a hack, but I know that it is a hack that is sometimes used ... and useful.   After the process has run through some number of requests, let it choose to commit suicide.   Then, ensure that some init-like process will recognize its death and immediately re-spawn it.   Exactly as is done sometimes with FastCGI, or even with mod_perl, especially when the app in question is oldy-moldy.   You make no attempt to re-engineer how the app goes about its business, having established that it still seems to work.   You simply modify it to, every now and again, put itself to death.   (Which is n-o-t the same as killing it!)

Of course, it is also possible to run it by means of a do-nothing “babysitter” process that launches the other process as a child, waits for it to die, and then takes care of re-launching it ... forever.

Hack.   Wart.   Inelegant.   Smells bad.   Quick.   Works.   Done.

  • Comment on Re: Perl and memory usage. Can it be released?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1073907]
help
Chatterbox?
[Corion]: erix: I'm not sure if it really is MySQL - maybe MS SQL also has LIMIT 0
[erix]: it has TOP, IIRC
[Corion]: erix: Ah. I use where 1 = 0 for queries where I only am interested in the structure ;)
[erix]: 1=0 is as short as TOP :)
[erix]: "code of someone that died" -- kinda nice if your code stops working too
[erix]: hard to implement, hmm

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-01-23 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (192 votes). Check out past polls.