Sometimes, either because of a memory leak or the computationally-intensive nature of a program, applications can start to slow down and ultimately freeze the whole system by claiming too much RAM or CPU time (or at least I think that's what's happening - please enlighten me if it's more complicated). I was wondering if it was possible to ringfence a certain amount of RAM or 'CPU time' for use purely by important system applications (basically anything not explicitly started by me - including the desktop environment) so that a greedy application can't freeze the whole system.
If it is possible, I'd also be curious as to why Ubuntu doesn't do it by default.