在指定的内存量下运行python程序

时间:2018-10-07 12:45:41

标签: python-3.x

我想知道如何使我的python程序以这样的方式运行:仅运行指定数量的内存(例如x字节),并且在需要更多内存的情况下运行比 x 应该终止。

我想要这样的东西:

if memory_required > x:
        Terminate program
else:
         Let the program run

0 个答案:

没有答案