JavaScript heap out of memory when running tests with TestSuite
galmalka opened this issue · 2 comments
galmalka commented
I'm submitting a...
- Bug report
- Feature request
- Documentation issue or request
- Other... Please describe:
Expected Behavior
When running a test for Jovo components (using TestSuite), the test should run with reasonable resources
Current Behavior
Running more than ~20 intents (on my machine) is causing a "heap out of memory" error.
Code playground
Error Log
RUNS src/component-outer-loop.test.ts
<--- Last few GCs --->
[990:0x7fc490008000] 84859 ms: Mark-sweep (reduce) 3698.2 (3791.6) -> 3698.1 (3760.6) MB, 3734.8 / 0.0 ms (average mu = 0.285, current mu = 0.000) last resort GC in old space requested
[990:0x7fc490008000] 88774 ms: Mark-sweep (reduce) 3698.1 (3760.6) -> 3698.1 (3760.6) MB, 3915.0 / 0.0 ms (average mu = 0.163, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0x10ffba515 node::Abort() (.cold.1) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
2: 0x10ecbb989 node::Abort() [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
3: 0x10ecbbaff node::OnFatalError(char const*, char const*) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
4: 0x10ee3b2c7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
5: 0x10ee3b263 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
6: 0x10efdc975 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
7: 0x10efe7c49 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
8: 0x10efad164 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
9: 0x10f267a2d v8::internal::MaybeHandle<v8::internal::OrderedHashMap> v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash<v8::internal::Isolate>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
10: 0x10f36199b v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
11: 0x10f713dd9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/***/.nvm/versions/node/v16.13.0/bin/node]
[1] 990 abort node node_modules/jest/bin/jest.js src/component-outer-loop.test.ts
Your Environment
- Jovo Framework version used: 4.2.12
- Operating System: Mac OS 12.1 (tried on Linux on docker also)
- Node: 16.13.0
- Jest: ^27.3.1
jankoenig commented
@aswetlow fixed this. The latest release should resolve this issue: https://github.com/jovotech/jovo-framework/releases/tag/2022-05-17-patch
Feel free to reopen if the issue persists.
Thanks!