When a Computer is run like a Bank
Firefox "crashed"!
Sorry to hear that.
Why do you think it crashed?
Well, it was killed by the oom-killer according to my console.
It crashed!
This isn't technically a crash
What actually happened?
- The log
shows Gecko used around 1.8gb of VM.
- Your system having no free swap/memory had to kill Firefox...
- ... because while it had promissed additional memory to Firefox, it didn't have it.
What does that mean?
Linux plays an amusing game... I can't remember if it's called
Liar's Bluff
or something else.
But to use a different expression:
"the
Kernel got caught with its pants down".
Who's the Colonel?
Oh, you've never served with him?
What would be a more current analogy?
Perhaps you're more familiar with Banks.
(This explanation was written on October 22, 2008.)
Banking
Think of your computer's OS like a bank.
Pick an
Icelandic
bank:
The bank promises a series of loans/investments and
banks on two things:
- turnover
- not everyone will ask for all their money (memory) at the same time
But in this case.... the bank made a promise and when investors (Firefox) came to
collect the money (memory) to use it, the bank (OS) said:
"Oops. I can't cover that loan."
What can the bank do?
It has a few choices:
- It can just close (computer panics and you lose everything).
- It can go into receivership.
Normally the bank just asks for a loan (swap) and is able to continue to function.
Sometimes loans can be too expensive, or maybe you configured the computer not to give them out....
What happens if it can't get a loan?
Then it has too do something about the current transaction.
Unlike a typical bank, the OS can fire/kill
its customer.
The real customer won't be very happy:
- It (you) loses everything.
- But the bank can try to recover for the rest of its customers (see
FDIC insurance for an example).
What can the bank do?
- The bank defaults on everyone
(full panic,
box is dead and may reboot or simply halt)
- You change the banking laws to refuse to allow overdrafts
(/proc/sys/vm/overcommit_memory)
- You increase liquidity (enable
swap,
add swap)
- Offer "unlimited liquidity" in the form of
dynamic swap (disk backed,
not quite a federal reserve loan)