限制Python VM内存 [英] Limit Python VM memory

查看:115
本文介绍了限制Python VM内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图找到一种方法来限制Python VM可用的内存,就像Java VM中的选项"-Xmx"一样. (这个想法是为了能够使用MemoryError异常)

我不确定该选项是否存在,但是可能存在使用操作系统命令来隔离"进程及其内存的解决方案.

谢谢.

解决方案

在* nix上,您可以使用ulimit命令,尤其是-m(最大内存大小)和-v(虚拟内存). >

I'm trying to find a way to limit the memory available for the Python VM, as the option "-Xmx" in the Java VM does. (The idea is to be able to play with the MemoryError exception)

I'm not sure this option exist but there may be a solution using a command of the OS to "isolate" a process and its memory.

Thank you.

解决方案

On *nix you can play around with the ulimit command, specifically the -m (max memory size) and -v (virtual memory).

这篇关于限制Python VM内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆