Skip to content

Getting Javascript heap out of memory on a project with 200+ .graphql files #281

@joual

Description

@joual

We'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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug :-(stage/5-alpha-release-testingThe pull request is merged, an alpha release is available, to be tested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions