From aa3158576a9b94764b6bc01e6768f770cb617c85 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Tue, 30 May 2023 13:53:59 +0200 Subject: [PATCH] max-memory support for Mac --- run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index 327bee8..af7088c 100644 --- a/run.py +++ b/run.py @@ -46,12 +46,12 @@ if os.name == "nt": def limit_resources(): if args['max_memory'] >= 1: memory = args['max_memory'] * 1024 * 1024 * 1024 - if str(platform.system()).lower() == 'linux': - import resource - resource.setrlimit(resource.RLIMIT_DATA, (memory, memory)) if str(platform.system()).lower() == 'windows': import win32api win32api.SetProcessWorkingSetSize(-1, memory, memory) + else: + import resource + resource.setrlimit(resource.RLIMIT_DATA, (memory, memory)) def pre_check():