Skip to content
Latchkey

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.

Cypress output
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
// cypress.config.js
module.exports = {
  numTestsKeptInMemory: 0,
  e2e: { experimentalMemoryManagement: true },
};

Give Chromium more shared memory

Terminal
# 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 experimentalMemoryManagement and a low numTestsKeptInMemory in CI.
  • Run on containers with --shm-size raised (or --disable-dev-shm-usage).
  • Split very long specs to cap per-spec memory growth.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →