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.

Frequently asked questions

What causes ""out of memory or has crashed""?
Cypress keeps command snapshots for time-travel debugging. Across hundreds of commands in one spec, browser memory climbs until the renderer is OOM-killed.
How do I fix "out of memory or has crashed"?
Turn down numTestsKeptInMemory and disable in-memory snapshots in CI runs.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card