What would be a good alternative whole-system-crash prevention method? Preferably not based on maximum (per-terminal) memory allocation limits but the other way around: some way to reserve enough memory for system (critical) processes (a few whitelisted processes). Or simply (put) some way to block running new processes when the system reaches some limit. Or at least some monitoring application with notifications/warnings.
One option might be to adjust the value of
/proc/<pid>/oom_score_adj to prevent the oom killer to kill the process in case of low memory situation. Setting the value to
-1000 will prevent the kernel to kill the process completely.