I run Python 2.7 on a Linux machine with 16GB Ram and 64 bit OS. A python script I wrote can load too much data into memory, which slows the machine down to the point where I cannot even kill the process any more.
While I can limit memory by calling:
ulimit -v 12000000
_, hard = resource.getrlimit(resource.RLIMIT_DATA)
resource.setrlimit(resource.RLIMIT_DATA, (12000, hard))
subprocess.call('ulimit -v 12000', shell=True)
AttributeError: 'module' object has no attribute 'RLIMIT_VMEM' message: the
resource module docs mention this possibility:
This module does not attempt to mask platform differences — symbols not defined for a platform will not be available from this module on that platform.
According to the
ulimit source linked to above, it uses
RLIMIT_VMEM is not defined.