Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Perl script end up on saying "Out of Memory !"

by armstd (Friar)
on Sep 23, 2011 at 14:35 UTC ( #927573=note: print w/replies, xml ) Need Help??

in reply to Perl script end up on saying "Out of Memory !"

Since it appears each file is processed independently of each other, and no state is maintained in memory, you might also consider forking processes to handle each file instead of doing it directly in one process. Your parent process won't be affected by any memory consumed by child processes.

Also, if you 'exec "/bin/true"' or some-such instead of 'exit()' at the end of each child process, you'll find that memory frees up much faster than waiting for perl garbage collection, helping performance too.


  • Comment on Re: Perl script end up on saying "Out of Memory !"

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-10-28 22:28 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (387 votes). Check out past polls.