Skip to content

Increase default agent container memory limit from 2GB to 6GB #1355

@Mossaka

Description

@Mossaka

Problem

The AWF agent container defaults to a 2GB memory limit with no swap, causing OOM kills (exit code 137) for large projects. GitHub Actions ubuntu-latest runners provide 7GB RAM — the current default gives agents only 28.5% of the memory they'd have without AWF.

Evidence

Four repos consistently fail with OOM in the v6 build-test experiment:

Repo Failure Mode Evidence
javascript/prettier Copilot CLI killed mid-execution line 9: 137 Killed /bin/bash -c '/usr/local/bin/copilot ...'
k8s/k9s Go linker OOM github.com/derailed/k9s: .../link: signal: killed
k8s/stern Go linker OOM Same pattern as k9s — large Go dependency tree
erlang/cowboy Common Test OOM req_SUITE (900 test cases) killed with exit code 137

Exit code 137 = SIGKILL from the container OOM killer. These projects build fine on standard GitHub Actions runners with 7GB RAM.

Code Reference

// src/docker-manager.ts:1031-1032
mem_limit: config.memoryLimit || '2g',
memswap_limit: config.memoryLimit || '2g',  // No swap (same as mem_limit)

Resource Budget

The full AWF container stack on a 7GB runner:

Container Current Proposed
Agent 2GB 6GB
Squid proxy 512MB 512MB
DoH resolver 128MB 128MB
DNS init 128MB 128MB
Total ~2.8GB ~6.8GB

The proposed 6.8GB total fits within the 7GB runner budget while giving the agent 85% of available memory (vs 28.5% today).

Proposed Fix

  1. Increase default mem_limit from '2g' to '6g' in src/docker-manager.ts:1031-1032
  2. Enable swap by setting memswap_limit to -1 (unlimited) or a value higher than mem_limit (e.g., '8g'), so the kernel can use swap as a pressure valve instead of immediately OOM-killing
  3. The --memory-limit CLI flag already exists and will continue to work for users who want custom limits

Impact

This would immediately unblock 4 repos (prettier, k9s, stern, cowboy) that have been persistently failing across v5 and v6 experiments, without requiring any per-workflow configuration changes.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions