Relative Content

Tag Archive for debianout-of-memoryprocess-group

oom killer kills unwanted process

Introduction:
main– an executable(a c++ code that was compiled using g++). This is a big program, which shouldn’t stop running. if for any reason it stops, we would like to run it again.
run.sh – a shell script. run.sh calls main. if main stops running, its responsibility is to run main again. basically implements a watchdog. to try to avoid oom killer to kill also run.sh when main is killed (because it uses a lot of memory), I tried to find a solution on the internet and encountered the following:
the script executes main using the setsid command, meaning main will run in a different process group than run.sh
my_vm– a debian 11 vm
big_memory – an executable, simply a code with an infinite while loop, that calls malloc to allocate memory.