Why 1GB Cloud Instances Die with "OOMKilled (Exit Code 137)"
AWS EC2 t3.micro instances and $4/month DigitalOcean droplets come provisioned with 1024MB of physical RAM and zero swap space by default. When an automated Python or Node.js agent launches a Playwright or Crawl4AI browser to scrape a page, Chromium's V8 engine spawns multiple renderer subprocesses.
On heavy modern sites with multi-megabyte JavaScript bundles, Chromium's memory allocation surges past 950MB in less than 200 milliseconds. Because the host kernel has no swapfile to page dirty anonymous memory to disk, the Linux kernel Out-Of-Memory Killer (oom-killer) immediately terminates the offending process with a SIGKILL (Exit Code 137).
The 3-Step Production Swapfile Blueprint
Configuring a 2GB NVMe swapfile with tuned kernel swappiness completely cures unexpected process termination on budget cloud servers:
# 1. Allocate 2GB swap space and secure file permissions
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# 2. Persist across server reboots in /etc/fstab
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# 3. Configure swappiness (10 prevents premature disk thrashing)
sudo sysctl vm.swappiness=10
sudo sysctl vm.vfs_cache_pressure=50