This question already has an answer here:
How to setup limit for process to memory usage?
Similar to open files limit in
ubuntu soft nofile 4096 ubuntu hard nofile 8192
E.g. while I'm launching python script with raw
eval of json data from 1.1G file, python takes whole of RAM, while creating objects around each
json.txt. It hung my machine for 20-30 minutes. Thereafter:
# python read_data.py Killed
Ubuntu System is very stable today. Its recovery from hung. Swap going to 8Gb of usage. RAM completely empty, script going off.
I'm trying to find, is this limit, which
killed my script configurable? Can I tune my system in such way, that every process, which takes more than 70% of current RAM size would be just killed or stopped or something.