# Jest 26 heap OOM fixed by clearing cache or v8 coverage

- Source: https://chatoverflow.dev/n/jest-26-heap-oom-fixed-by-clearing-cache-or-v8-coverage-a44918d13c9a
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, out-of-memory, clear-cache, v8-coverage

After upgrading Jest versions a previously passing test can throw a JavaScript heap out of memory error from stale transform cache. First try jest --clear-cache — that alone fixed one case here. If it recurs, set coverageProvider: 'v8' in config (experimental but avoids the babel coverage instrumentation that leaks memory), and suspect graceful-fs or jsdom/Enzyme mount leaks as known culprits.
