BLACK FRIDAY 2026 ACTIVO: RackNerd 4GB VPS $47.98/año (de por vida) · ElevenLabs 55% OFF · Hardware IA en Amazon Ver Ofertas Verificadas →
Lab Essay #11 · Browser Agent Stability8 min readReal Lab Measurements

Why 24/7 AI Browser Agents Leak Memory: Headless Chromium Zombie PIDs, 64 MB /dev/shm Crashes & Hard cgroup Caps

TL;DR

Three Linux container defaults quietly break 24/7 AI browser agents like OpenClaw: Docker caps `/dev/shm` at a tiny **64 MB** (crashing Chromium tabs randomly), omitting `init: true` leaves dead Chromium child renderers as zombie processes forever, and uncapped Node/browser pools consume 100% of host RAM. Add `init: true`, `shm_size: "1gb"`, `mem_limit: 3g`, and a 2 GB host swapfile (`vm.swappiness=10`) to keep OpenClaw rock-solid for weeks.

Live terminal screenshot showing free -h memory available, 2 GB /swapfile usage, dockerd/containerd RSS footprint, and vm.swappiness check
Figure 1 · Live Memory & Swap Telemetry on 4 GB Ubuntu 24.04 KVM Host: Always measure actual container runtime overhead first: dockerd (67 MB) + containerd (73 MB) + cloudflared (39 MB) take ~180 MB before your browser agent opens its first Chromium tab.

1. The 64 MB /dev/shm Crash Nobody Connects to Docker

If your headless browser agent runs fine on your MacBook and then crashes unpredictably on a Linux VPS with `Target closed` or `RESULT_CODE_KILLED_BAD_MESSAGE`, you probably did NOT run out of VPS RAM. By default, Docker mounts `/dev/shm` (POSIX shared memory used heavily by Chromium’s compositor and raster tiles) at **64 MB**—even on a 32 GB server.

The moment an AI agent opens two modern React/SPA tabs or captures a full-page screenshot, Chromium exhausts 64 MB of `/dev/shm` and the renderer process dies violently. Setting `shm_size: "1gb"` in `docker-compose.yml` eliminates this entire class of phantom crashes.

2. Hardened OpenClaw / Browser-Agent Compose Block

Combine `init: true`, `shm_size: "1gb"`, explicit `pids_limit: 256`, and `NODE_OPTIONS=--max-old-space-size=2048` so a runaway scrape page can never take down your entire VPS:

  openclaw:
    image: ghcr.io/openclaw/openclaw:latest
    restart: unless-stopped
    init: true               # Reaps zombie Chromium child processes automatically
    shm_size: "1gb"          # Fixes Docker's 64 MB /dev/shm tab crashes
    mem_limit: 3g
    pids_limit: 256
    environment:
      - NODE_OPTIONS=--max-old-space-size=2048
      - TZ=UTC

Related Engineering Deep-Dives