Earlier quoted context omitted.
This happens whenever I load up one of our PyTorch models on my M1 MBP 16gb too. I also hate the part where if the model (or any other set of programs) uses too much RAM the whole system will sometimes straight up hang and then crash due to kernel watchdog timeout instead of just killing the offender.
There is an API `proc_setpcontrol` which absolutely noone uses which does the thing you want. It definitely gets unstable in those situations, but you probably don't want your scripts randomly OOM killed either.
Gee, I wonder why.
$ man proc_setpcontrol
No manual entry for proc_setpcontrol