WebFaction
Community site: login faq
1
1

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
11147
accept rate: 0%


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.

permanent link

answered 30 Nov '13, 20:04

johns
5.4k312
accept rate: 23%

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.

permanent link

answered 16 Jun '14, 14:41

delizseemack
12
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×87

question asked: 30 Nov '13, 19:27

question was seen: 44,869 times

last updated: 16 Jun '14, 14:41

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM