I've had this problem come up a few times and Google isn't my friend this time. Is there a quick way to recover from a swap lock? They can sometimes last twenty or more minutes which is a long time to wait if a hard reset isn't possible.
The ideal solution that I'm looking for is a utility that would halt all execution and pop up a task manager-style interface so unnecessary, memory-consuming processes can be killed. Is there something like this, or another way to recover quickly?
The easy answer is: don't have so much swap.
When you really run out of memory (as in, you've used all RAM and swap), the kernel will invoke it's out of memory killer, which (in many situations) will kill off the offending program. As long as you still have swap space, the kernel thinks everything is fine. If you can't use 4G of swap usefully, don't provide 4G of swap.
There are only two situations I can think of, where lots of swap is useful:
More hints: