Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Safely reading line by line

by martin (Friar)
on Jun 27, 2007 at 16:49 UTC ( #623673=note: print w/replies, xml ) Need Help??

in reply to Re: Safely reading line by line
in thread Safely reading line by line

A total memory limit for a process will limit the impact a single failure will have on the rest of the system. This is a reasonable precaution.

On my Debian GNU/Linux box I can call

ulimit -v 10000
in the shell before starting my program and it will no longer be able to use more than 10000 Kilobytes of virtual memory.

However, that is not all I wanted. I would like to be able to stop processing the input file as soon as its contents are known to be malformed and take whatever evasive action is most appropriate. This would rule out plainly crashing in many cases.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://623673]
Eily used google. The lazy internet equivalent of grep
[karlgoethebier]: He!
[Eily]: Discipulus pretty much all oneliners are killing. Do you imagine how many people could be working if you asked them to do the same thing in C each time ? :P
Eily is Listening to "Leave out all the rest" by Linkin Park
[karlgoethebier]: that's why trade unions like C ;-)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-07-21 09:25 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (320 votes). Check out past polls.