2

Is it possible to limit the amount of memory a process consumes from the command line and eventually automatically kill the process if it tries to overpass this limit?

Something like

MaxRam -4GB ./MyProcess args

For your information, I am on Mac OSX Version 10.11.3.

2
  • 1
    On Linux there is a ulimit command which allows control over the resources "on systems that allow such control" (help ulimit or man bash for information), but I don't know if the limit extends to any or all subprocesses launched; if not OSX may have system programs to specify the limits on a program as it is run, but this would not be a bash internal command.
    – AFH
    Apr 6, 2016 at 22:05
  • more answers/comments can be found here -- it seems like there is no way to do this (please feel free to correct me!) Feb 17, 2018 at 23:43

0

You must log in to answer this question.

Browse other questions tagged .