Getting Javascript heap out of memory on a project with 200+ .graphql files
See original GitHub issueWe’re currently on 0.4.2 and anything 5.x+ above yields the following after a while. It’s also much slower.
<--- Last few GCs --->
[24472:0x102d75000] 306785 ms: Mark-sweep 2023.8 (2052.1) -> 2023.7 (2052.3) MB, 1474.0 / 0.0 ms (average mu = 0.130, current mu = 0.043) allocation failure scavenge might not succeed
[24472:0x102d75000] 307875 ms: Mark-sweep 2024.3 (2052.6) -> 2023.4 (2052.3) MB, 1088.5 / 0.0 ms (average mu = 0.079, current mu = 0.002) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x100a02a19]
1: StubFrame [pc: 0x1009e301f]
Security context: 0x1d6de70408d1 <JSObject>
2: split [0x1d6de704cd51](this=0x1d6daea94379 <String[46]\: \n Get list of analyze views of this survey\n >,0x1d6daea94399 <JSRegExp <String[#11]: \r\n|[\n\r]>>)
3: readBlockString(aka readBlockString) [0x1d6d1f766d19] [/Users/joelm/dev/webplatform/smweb/node_modules/graphql/language/lexer.js:~573] [pc=0x2b01f005cf8e...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x1011f40c5 node::Abort() (.cold.1) [/usr/local/bin/node]
2: 0x1000a5749 node::Abort() [/usr/local/bin/node]
3: 0x1000a58af node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
4: 0x1001eddb7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x1001edd57 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
6: 0x1003848f5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
7: 0x10038614a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
8: 0x100382bce v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0x100380980 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
10: 0x10038c7aa v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x10038c831 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12: 0x10035a9aa v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
13: 0x1006aa1d8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x100a02a19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
15: 0x1009e301f Builtins_RegExpSplit [/usr/local/bin/node]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
Top Results From Across the Web
JavaScript heap out of memory when packaging many ...
What you can try is, to increase node's heap memory limit (which is at 1.7GB by default) with: node --max-old-space-size=4096 node_modules/ ...
Read more >How to Fix JavaScript Heap Out of Memory Error
A common problem while working on a JavaScript Node.js project is the “JavaScript heap out of memory” error. This error usually occurs when ......
Read more >JavaScript Heap Out Of Memory Error
A quick solution that you can use to fix "Heap Out Of Memory Error" in JavaScript. We lay out the causes and how...
Read more >'jss bootstrap' causes JavaScript heap out of memory error ...
In another component I want to make a GraphQL request to get some data from Sitecore. Following the sample component GraphQL-ConnectedDemo.
Read more >fatal error: ineffective mark-compacts near heap limit ...
I am getting the error FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory: in the react.js, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@B2o5T pushed some fixes in https://github.com/dotansimha/graphql-eslint/pull/511 , that should improve that, let’s give it a try with next release 😉
Please try
@graphql-eslint/eslint-plugin@1.1.3