From b53844eb57bbd5f639cbf7a2077a879e1c3e2c5b Mon Sep 17 00:00:00 2001 From: Ihor Kuzmychov <37931581+iikuzmychov@users.noreply.github.com> Date: Sat, 29 Aug 2026 08:53:57 +0200 Subject: [PATCH] fix: skip setrlimit(RLIMIT_DATA) on macOS (#1849) setrlimit(RLIMIT_DATA) is rejected by the macOS kernel for the values used here, crashing the app during startup. Since --max-memory defaults to suggest_max_memory() (4 on Darwin), max_memory is always set on macOS and every launch reached this call. Fixes #1848. --- modules/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core.py b/modules/core.py index 520e410..bea8c6c 100644 --- a/modules/core.py +++ b/modules/core.py @@ -178,6 +178,10 @@ def limit_resources() -> None: tensorflow.config.experimental.set_memory_growth(gpu, True) # limit memory usage if modules.globals.max_memory: + # setrlimit(RLIMIT_DATA) fails with EINVAL on macOS, crashing on launch. + # See https://github.com/hacksider/Deep-Live-Cam/issues/1848 + if platform.system().lower() == 'darwin': + return memory = modules.globals.max_memory * 1024 ** 3 if platform.system().lower() == 'windows': import ctypes