Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: High RAM script takes forever to terminate

by Fletch (Bishop)
on Nov 19, 2008 at 21:47 UTC ( [id://724736]=note: print w/replies, xml ) Need Help??

in reply to High RAM script takes forever to terminate

The OS this is happening on would be helpful, but first impression is that you're not helping by explicitly trying to explicitly undef or otherwise zero out your data structures. On most OSen it's not possible to return memory from a running process (Windows and I believe several flavours of *BSD can) short of the process terminating. If anything you're probably making the underlying malloc/free machinery do extra work putting all that memory back into its free lists for nothing (since you're already exiting it's not going to be reused by the current process).

A utility like strace/truss/ktrace might be of use to see what sort of system calls are being made during the period after you've started exiting (if any, which may shed light on what's going on and leaving you hung).

Update: Expanded with parenthetical in second paragraph.

The cake is a lie.
The cake is a lie.
The cake is a lie.

  • Comment on Re: High RAM script takes forever to terminate

Replies are listed 'Best First'.
Re^2: High RAM script takes forever to terminate
by jgrundstad (Initiate) on Nov 19, 2008 at 21:52 UTC
    Currently using CentOS 5.

    The malloc issue you raise makes a lot of sense. I'll see if dropping those calls helps anything. Also, I'll take a look at those utilities and see what I find.


Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-05-20 05:42 GMT
Find Nodes?
    Voting Booth?

    No recent polls found