From a7bcfb26ab91f2d7955760119904d842df8d92eb Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Mon, 11 Apr 2022 14:24:35 -0700 Subject: [PATCH] dev: Limit devcontainer memory usage to 8GB (#1604) Devconatiner memory usage is currently unbounded. This allows runaway processes (like rust-analyzer) to monopolize system resources, causing memory exhaustion for the host OS. This change adds a limit so that the oomkiller reaps devcontainer processes when they exceed 8GB. Signed-off-by: Oliver Gould --- .devcontainer/devcontainer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c0101b47c3..f249b8a637 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,6 +12,9 @@ // Support docker + debugger "runArgs": [ "--init", + // Limit container memory usage. + "--memory=8g", + "--memory-swap=8g", // Use the host network so we can access k3d, etc. "--net=host", // For lldb