Pagefaulting. Endlessly. You know, thrashing.
In theory, having 12,582,912 times as many bits of memory as the Apollo Guidance Computer would mean that I could run 12 million tasks roughly as complex as navigating a rocket to the moon and back simultaneously without breaking a sweat. In practice, things aren't quite so rosy.
It's happened to me maybe four times in the last year. I'll be minding my own business cranking out some code or whatever, when suddenly the whole system gets a little slow. I look at the memory usage indicator and it's just gone to solid dark green, indicating 100% usage. Crap. Some buggy background process has suddenly decided it desperately needs 4.5GB of ram for god knows what. Once it was vlc, once some lame-o toolbar widget, once it was a random python process... Ugh.
By now the GUI is totally locked. I desperatly mash ctrl-alt-f1, knowing that if I can just get to the console in time I can kill the process before everything I'm working on has been paged out to disk. If the kernel is in a particularly bad mood it may be some number of minutes before I can kill the evil process.
Apparently there is an OOM killer in the kernel which is sometimes activated in these situations, which aims to:
* 1) lose the minimum amount of work done
* 2) recover a large amount of memory
* 3) don't kill anything innocent of eating tons of memory
* 4) kill the minimum amount of processes (one)
* 5) try to kill the process the user expects us to kill
Of course, a lot of the server guys don't like it. But it sounds like the perfect solution for a desktop system. If only the UI wouldn't block so much before it had a chance to work, the user might not even notice there had been a problem.
I found a bug in the Ubuntu repository about this, but it hasn't gotten much attention. My guess is most Ubuntu users don't abuse their machines enough to see this very often. The kernel maintainers argue that this isn't a bug, that the kernel is just doing the best it can with what it's told. Well, OK. Maybe a desktop system is a special use-case that deserves special behavior. But what exactly are we supposed to tell the kernel? Ideally, I'd say something like "If a process suddenly (within 1 minute) eats all the free memory and is consuming enough that there's pressure on the rest of the system, don't page out anything I'm working on that has been resident for days. Reduce this new process's priority for at least 5 minutes or so to give me time to analyze the situation and decide if it needs to be killed.
Now, there's ulimit and the various sysctl parameters like vm.swappiness that can all be tweaked and adjusted. Some of these look promising, but I'm reluctant to change any of them for fear I will make the problem worse or add a new, unrelated problem.
At any rate, this is a place where Ubuntu really falls down compared the commercial competition. I can't speak for OS X, but I know the Windows 7 UI, which you can use to shut down misbehaving processes, remains responsive even in the face of extreme memory pressure. Sure, it might take longer to finish the memory-hungry (and in all likelyhood, buggy and broken) process than a linux box would, but having the UI remain responsive at the cost of slower background tasks is just a good design choice.