Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Finding memory leaks

by gav^ (Curate)
on Apr 25, 2002 at 02:18 UTC ( [id://161838]=note: print w/replies, xml ) Need Help??


in reply to Finding memory leaks

I've always had the feeling that long running applications are prone to problems like this and try to avoid them. My workaround is to have the script in a cron job which is called every minute. It basically wakes up, checks to see if there are less than a certain amount of itself running, grabs a set of tasks (and marks them as in progress), processes them, logs action, and then marks them as complete.

Lately I've been wondering if there are any disadvantages to this method, but I can't seem to think of any (bar the script start up costs). Obviously this isn't applicable for any networking based daemons.

gav^

Replies are listed 'Best First'.
Rex2: Finding memory leaks
by Sweeper (Pilgrim) on Apr 25, 2002 at 05:40 UTC
    One disadvantage could be variable persistence. If you need to remember a variable for the whole duration of the task, you will have to store this variable in a permanent file (with Storable or similar module) and retrieve it later. With possible security problems.

    I think in your case, you are lucky not to need persistence. In your case, a cron job is good enough to prevent memory leaks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found