'trying to resolve FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
I am on Ubuntu 20.04.4 LTS.
node -v = 17.6.0
nvm -v = 0.39.1
npm -v = 8.7.0
jest -v = 27.5.1
I am trying to run a 'test.js' script using jest. This is the command I tryied in my project folder :
jest chunk/test.js --watch
I get this output :
RUNS chunk/test.js
<--- Last few GCs --->
[13746:0x4b3ad20] 29062 ms: Scavenge 2059.4 (2096.0) -> 2059.2 (2107.0) MB, 10.2 / 0.0 ms (average mu = 0.200, current mu = 0.165) allocation failure
[13746:0x4b3ad20] 29090 ms: Scavenge 2066.2 (2107.0) -> 2067.0 (2107.8) MB, 14.1 / 0.0 ms (average mu = 0.200, current mu = 0.165) allocation failure
[13746:0x4b3ad20] 29108 ms: Scavenge 2067.0 (2107.8) -> 2066.2 (2131.0) MB, 17.6 / 0.0 ms (average mu = 0.200, current mu = 0.165) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb2e180 node::Abort() [node]
2: 0xa4019e node::FatalError(char const*, char const*) [node]
3: 0xd1fc3e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xd1ffb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xed93e5 [node]
6: 0xed9ec6 [node]
7: 0xee9b3c [node]
8: 0xeea5b0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xeed4d5 v8::internal::Heap::HandleGCRequest() [node]
10: 0xe783d7 v8::internal::StackGuard::HandleInterrupts() [node]
11: 0x122eb05 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x1632879 [node]
Abandon (core dumped)
I tried this :
export NODE_OPTIONS="--max-old-space-size=8192"
But the result is that my computer freezes, and in the end the output is the same.
Thanks !!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
