Comment Re:or, plan B: (Score 2, Interesting) 603
I tried this, but it didn't help much.
As I ran out of memory, it will throw away the disk cache (including copies of currently running programs, IIRC) until it's constantly running back to the disk to grab the next chunk of needed code or data. At any rate, I had the exact same symptoms, but perhaps more acutely. A SSD might really help this as the random access thrashing wouldn't delay I/O nearly as much..
Linked to by the article, this might address this situation: http://www.phoronix.com/scan.php?page=news_item&px=ODQ3Mw
My solution was to learn the key combination Alt-SysRq-F - this basically tells the kernel to find the process taking the most memory and kill it. Hitting this (possibly a couple times) was the only realistic way to solve the situation, as I couldn't get to a terminal (due to the system being totally unresponsive) to check the currently running processes. (see also: https://secure.wikimedia.org/wikipedia/en/wiki/Magic_SysRq_key ) Note: it might need to be enabled, though in my experience it was enabled for some of the mainstream distros.