I frequently have this problem and I'm always aghast that no OS that I'm aware of has a good method to restrict resource usage to ensure the user can still perform essential tasks like terminate a problematic process. Instead, the machine just grinds to a halt and all you can do is sit and wait or else train your finger on the power switch.