Cypress "out of memory or has crashed" - Browser Crash in CI
The browser Cypress drives ran out of memory and was killed mid-run. Chromium accumulates DOM snapshots and memory across a long spec, and a small container shared-memory limit makes it crash.
What this error means
The run dies with "The Test Runner unexpectedly exited" and "We detected that the Chromium Renderer process just crashed... the browser ran out of memory." Remaining specs are skipped; it is an infrastructure crash, not an assertion failure.
The Test Runner unexpectedly exited via a exit event with signal SIGTRAP
We detected that the Chromium Renderer process just crashed.
This is the equivalent to seeing the 'sad face' when Chrome dies.
... the browser ran out of memory.Common causes
Snapshot memory growth over a long spec
Cypress keeps command snapshots for time-travel debugging. Across hundreds of commands in one spec, browser memory climbs until the renderer is OOM-killed.
Small container shared memory (/dev/shm)
Docker defaults /dev/shm to 64 MB. Chromium uses shared memory heavily and crashes when it is exhausted on a constrained CI container.
How to fix it
Reduce snapshot memory pressure
Turn down numTestsKeptInMemory and disable in-memory snapshots in CI runs.
// cypress.config.js
module.exports = {
numTestsKeptInMemory: 0,
e2e: { experimentalMemoryManagement: true },
};Give Chromium more shared memory
# Docker: raise /dev/shm or disable Chromium's use of it
docker run --shm-size=2g ...
# or pass the flag to the browser
# launchOptions.args.push('--disable-dev-shm-usage')How to prevent it
- Set
experimentalMemoryManagementand a lownumTestsKeptInMemoryin CI. - Run on containers with
--shm-sizeraised (or--disable-dev-shm-usage). - Split very long specs to cap per-spec memory growth.