-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript heap out of memory with pwa-kit 2.7.0 #1102
Comments
@axciccu we're going to need your help working through this. When we released node 16 support, the release was tested by multiple engineers on our side without seeing this issue. Let's start with some more info about your setup
|
Hi @bfeister these are the answers:
|
I've never heard of |
We occasionally get this with Node.js 14 pwa-kit 2.30, when the server runs for long enough or we trigger HRM a lot by saving very frequently. |
We have been investigating this extensively internally. Thanks for bringing to our attention |
Have wanted to open an issue about this for a couple of months now, glad to see someone beat me to it 🙂 . If it's of any help we have seen it happening on both macOS and Windows, and it's definitely not specific to There seems to be a memory leak somewhere which causes the JS heap to run out of memory after a significant amount of hot reloads. All devs on the team get the error numerous times a day (since January, at the least), we're using Node 14. From what I've seen, increasing Node's memory limit with Additionally, I've been storing some of the errors/stacktraces for when reporting the issue: Heap error (1)
Heap error (2)
Heap error (3)
Complete log from `.npm/_logs/*-debug.log`
|
we have a solution that we are testing at the moment -> #1155 |
The change is merged. This change will most likely go out with the upcoming V3 release. |
Just to add that this issue is still present in the version 3.1.0 of pwa-kit with node 18.12.0 and npm 8.19.2. |
@axciccu Thank you for pointing that out. We're looking into the issue. |
Summary
With the pwa-kit 2.7.0 that supports node 16, this error appears:
<--- Last few GCs --->
[20144:000001EBD9220D30] 277664 ms: Scavenge 2023.4 (2057.2) -> 2022.2 (2057.2) MB, 4.1 / 0.0 ms (average mu = 0.637, current mu = 0.705) allocation failure
[20144:000001EBD9220D30] 278649 ms: Mark-sweep 2066.1 (2099.1) -> 2063.4 (2099.4) MB, 727.3 / 0.1 ms (average mu = 0.472, current mu = 0.311) allocation failure GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF7C1B3168F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+122159
2: 00007FF7C1ABB456 DSA_meth_get_flags+64118
3: 00007FF7C1ABC4D2 DSA_meth_get_flags+68338
4: 00007FF7C23F3CB4 v8::Isolate::ReportExternalAllocationLimitReached+116
5: 00007FF7C23DE27D v8::SharedArrayBuffer::Externalize+781
6: 00007FF7C228183C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
7: 00007FF7C227E954 v8::internal::Heap::CollectGarbage+4244
8: 00007FF7C227C2D0 v8::internal::Heap::AllocateExternalBackingStore+2000
9: 00007FF7C2299FE0 v8::internal::FreeListManyCached::Reset+1408
10: 00007FF7C229A695 v8::internal::Factory::AllocateRaw+37
11: 00007FF7C22AC83D v8::internal::FactoryBasev8::internal::Factory::AllocateRawOneByteInternalizedString+109
12: 00007FF7C22AFA69 v8::internal::FactoryBasev8::internal::Factory::NewOneByteInternalizedString+25
13: 00007FF7C209574A v8::internal::String::ToCString+6026
14: 00007FF7C22AC29B v8::internal::FactoryBasev8::internal::Factory::InternalizeStringWithKey<v8::internal::SequentialStringKey >+27
15: 00007FF7C23CBEE4 v8::internal::AstValueFactory::Internalizev8::internal::Isolate+164
16: 00007FF7C2074C3E v8::internal::Parser::DoParseProgram+1790
17: 00007FF7C207B244 v8::internal::Parser::ParseProgram+468
18: 00007FF7C206F5D6 v8::internal::parsing::ParseProgram+278
19: 00007FF7C23751C5 v8::internal::Compiler::CompileSharedWithBaseline+1701
20: 00007FF7C2379A9D v8::internal::Compiler::GetWrappedFunction+1213
21: 00007FF7C23D8AF5 v8::ScriptCompiler::CompileFunctionInContext+1637
22: 00007FF7C1AC631A node::OnFatalError+40506
23: 00007FF7C23AE676 v8::internal::Builtins::code_handle+172806
24: 00007FF7C23AE269 v8::internal::Builtins::code_handle+171769
25: 00007FF7C23AE52C v8::internal::Builtins::code_handle+172476
26: 00007FF7C23AE390 v8::internal::Builtins::code_handle+172064
27: 00007FF7C2481A71 v8::internal::SetupIsolateDelegate::SetupHeap+494641
28: 000001EBDAF9A7B2
error: Command failed: node C:\test\pwa-kit-starter-project\app\ssr.js
Steps To Reproduce
Expected result
The component should be modified and the application should work properly.
Actual result
The application crashes with the error above.
System Information (as applicable)
Node version: 16.19.1 (also tried with 16.16.0)
pwa-kit version: 2.7.0
Desktop OS: Windows 10
Additional information
Note that I also tried to use the node version 16.16.0 and to add the --noHMR option but the error still occurs.
The text was updated successfully, but these errors were encountered: