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.
This commit is contained in:
Ihor Kuzmychov
2026-08-29 14:53:57 +08:00
committed by GitHub
parent 20cafb0079
commit b53844eb57
+4
View File
@@ -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