Sometimes, a process on my computer uses a lot of RAM, and ends up using the SWAP. Therefore, my computer becomes extremely buggy, and I can't even toggle a terminal or a virtual console to kill the program which is using the resources.
I want to know if there is a way to keep some untouched resources (RAM) or give some special priority for the virtual console, so it doesn't get affected when my computer gets buggy from using resources, and I can easily use the virtual console to kill that program that is causing the problem.