Hello all Is there a way to set the max allowed memory for a given python script? Whether it be with a flag from console or from within the script itself? Thanks! asked 30 Nov '13, 19:27 mcmaxx |
There is not a parameter which does this, you must debug the script and make sure it does not load large objects into memory, line by line. answered 30 Nov '13, 20:04 johns |
There are multiples solutions to this problem. There is the resource module which can you use to setup memory limit on your python script. This will not limit the child process spawned by your script. You might need to manage those separately. There is the also this ulimit unix tool which can be used to restrict virtual memory usage. answered 16 Jun '14, 14:41 delizseemack |