title: Node.JS FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed?
body: <p>My Node.JS script responds with this error: </p>
  
  <blockquote>
    <p>error: Forever detected script was killed by signal: SIGKILL error:
    Script restart attempt #15</p>
  </blockquote>
  
  <p>Last few GCs:</p>
  
  <blockquote>
    <p>[11266:0x2890040] 75587 ms: Mark-sweep 1363.8 (1424.5) -> 1363.5
    (1423.5) MB, 1341.2 / 4.2 ms (average mu = 0.168, current mu = 0.119)
    allocation failure scavenge might not succeed [11266:0x2890040] 75605
    ms: Scavenge 1364.1 (1423.5) -> 1363.8 (1424.0) MB, 11.4 / 0.0 ms
    (average mu = 0.168, current mu = 0.119) allocation failure
    [11266:0x2890040] 75621 ms: Scavenge 1364.4 (1424.0) -> 1364.2
    (1425.0) MB, 10.6 / 0.0 ms (average mu = 0.168, current mu = 0.119)
    allocation failure</p>
  </blockquote>
  
  <p>JS stacktrace</p>
  
  <pre><code>==== JS stack trace =========================================
  
  0: ExitFrame [pc: 0x2b010e34fb5d]
  1: StubFrame [pc: 0x2b010e350eca]
  Security context: 0x17ee2c91d969 2: normalizeString(aka normalizeString) [0x47fafaaaf01] [path.js:~57] [pc=0x2b010e58d424](this=0x2202476025b1 ,0x3086a38e3169 ,0x220247602801 ,0x10ca23627b19 ,0x047fafaaaf41 ) 3: /* anonymous */(aka...
  
  FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0x90af00 node::Abort() [node] 2: 0x90af4c [node] 3: 0xb05f9e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node] 4: 0xb061d4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node] 5: 0xf0c6f2 [node] 6: 0xf0c7f8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node] 7: 0xf18f88 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node] 8: 0xf19b1b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 9: 0xf1c851 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node] 10: 0xee6834 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node] 11: 0x11a0672 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node] 12: 0x2b010e34fb5d Aborted (core dumped)
  </code></pre>