Skip to content

Commit

Permalink
dev: Limit devcontainer memory usage to 8GB (#1604)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
olix0r authored Apr 11, 2022
1 parent bf38953 commit a7bcfb2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7bcfb2

Please sign in to comment.