#4631·ts-jest

[Bug]: Upgrading to 29.2.5 leads to FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Author: ortegarenzyCreated Nov 14, 2024Updated Aug 12, 2025
LabelsBug ReportNeeds Triage

Version

29.2.5

Steps to reproduce

Unable to shared private repository

Expected behavior

Same as in 29.2.3

Actual behavior

After upgrading our unit tests fail with the following message:

<--- Last few GCs ---> -- 407 |   408 | [719:0x7022660] 45959 ms: Mark-Compact (reduce) 1533.1 (1563.3) -> 1532.1 (1563.5) MB, 1638.59 / 0.00 ms (average mu = 0.144, current mu = 0.014) allocation failure; scavenge might not succeed 409 |   410 |   411 | <--- JS stacktrace ---> 412 |   413 | FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 414 | ----- Native stack trace ----- 415 |   416 | 1: 0xb82c78 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node] 417 | 2: 0xeefa80 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node] 418 | 3: 0xeefd67 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node] 419 | 4: 0x1101905 [node] 420 | 5: 0x1119788 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 421 | 6: 0x10ef8a1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node] 422 | 7: 0x10f0a35 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node] 423 | 8: 0x10ce086 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node] 424 | 9: 0x1529eb6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node] 425 | 10: 0x1963ef6 [node] 426 | Aborted (core dumped) 427 | ·ELIFECYCLE· Test failed. See above for more details.

Debug log

Unable to share due to private repos

Additional context

No response

Environment

bash
System:
    OS: Ubuntu 22.0
    CPU: 3 GB memory, 2 vCPUs
  Binaries:
    Node: v20.14.0
    npm: 10.7.0
  npmPackages:
    jest: 29.7.0