I am a software developer and I come into contact with a lot of unstable software. Recently I made a small game, which for some reason memleaks until the system hangs and is unresponsive. Usually, REISUB helps, but sometimes not even that and you need to do a hard poweroff.
Then it happened to me again with another program, so I thought to myself that this could easily be prevented by writing a script that monitors mem usage and if it crosses a certain value per PID over a certain amount of time, it gets a SIGKILL to take it down immediately.
Any ideas? Thanks
prlimit, i.e. setting a limit for a single process from the OS side. The other option depends on the programming language you use: set a memory limit in the code itself.