Re: Why does Linux crash?
On Tue, Apr 19, 2011 at 10:57:19PM -0400, Borden Rhodes wrote:
> Good evening,
> I do mean this earnestly and, despite my frustration, I am not trying
> to flame the good people of Debian, GNU or Linux. Nevertheless, I
> have to ask: why is it that in 2011, the world's greatest operating
> system lets Eclipse seize control of my computer, eat up 2 GB of RAM,
> monopolise a 2.2 GHz, dual-core processor and flood my hard drive with
> I/O? I thought that a computer capable of processing over 4 billion
> operations a second could sort itself out in 20 minutes but, alas, I
> had to yank the power.
> I thought the Linux kernel was supposed to have controls in place to
> prevent programs from getting away with this. Of course, the problems
> inherent in Java, and by extension, Eclipse, are a whole other topic.
> However, is there a kernel task force working to prevent this from
> happening and, if so, what's the best way of giving them feedback when
> my system locks up so they can plug up the hole? I hate to think what
> a malicious program could do to a web server if Eclipse can do this to
> my computer.
The central point is: what rights/limits do you give to your programs?
on Web servers, such limits are normally activated -- while they are
deactivated on private systems.
Just a few examples:
- you can add disk quota for each user/directory, limiting its maximal
size and thus preventing the hard disk of overflowing
- you can use "ulimit" to pass runtime-limits to eclipse (how much ram
it may use, how much calculation time, ....)
- you can limit the priority of eclipse compare to other jobs (that is:
if the processor is occupied, will he give calculation time to
eclipse or to something else?)
- you can adjust which processes are killed in which order if you run
out of memory (by adjusting /proc/PID/oom_adj)
But the principal problem is: each of those limits/protections reduces
the usability (e.g. if you have 2GB Ram, and you limit eclipse to 2GB,
it will be killed by the Kernel as soon as it tries to use 2GB and 1
byte from the SWAP -- which would not cause a problem at all). and only
YOU can decide what you want ;-) May be there are people how give a
difficult task to eclipse and accept then to wait 2h until it
That's the reason (I believe) that those features are not activated by
default on "private" computers. And e.g. for Debian: It is almost
impossible to define "sensible" rules which would apply for ALL
computers and ALL users where Debian will be installed -- so I think the
solution "don't apply restrictions by default" is the best approach...