Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2015-11-27 08:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (722 votes), past polls