question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Allocation failed - JavaScript heap out of memory

See original GitHub issue

This error happens when Webpack is trying to rebuild the code after frontity dev has been running for a while.

<--- Last few GCs --->

[50072:0x10268f000] 19835577 ms: Mark-sweep 1369.9 (1406.9) -> 1369.9 (1406.9) MB, 318.2 / 0.0 ms  (average mu = 0.249, current mu = 0.000) last resort GC in old space requested
[50072:0x10268f000] 19835886 ms: Mark-sweep 1369.9 (1406.9) -> 1369.9 (1406.9) MB, 309.2 / 0.0 ms  (average mu = 0.142, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0xec93b85be3d]
    1: ConstructFrame [pc: 0xec93b80d145]
    2: StubFrame [pc: 0xec93b889d9d]
Security context: 0x1b1f47a1e6e9 <JSObject>
    3: new Script(aka Script) [0x1b1f1e79a5d9] [vm.js:80] [bytecode=0x1b1fa055e909 offset=373](this=0x1b1fe0682801 <the_hole>,/* anonymous */=0x1b1f632028e9 <Very long string[3972035]>,/* anonymous */=0x1b1f63202911 <Object map = 0x1b1f995540b9>)
    4: ConstructFrame [pc: 0xec93b8...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x10003c597 node::Abort() [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 2: 0x10003c7a1 node::OnFatalError(char const*, char const*) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 3: 0x1001ad575 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 4: 0x100579242 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 5: 0x100582744 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 6: 0x100554534 v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 7: 0x100686109 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 8: 0x100719ec3 v8::internal::parsing::ParseProgram(v8::internal::ParseInfo*, v8::internal::Isolate*) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
 9: 0x1002cf069 v8::internal::(anonymous namespace)::CompileToplevel(v8::internal::ParseInfo*, v8::internal::Isolate*) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
10: 0x1002d0594 v8::internal::Compiler::GetSharedFunctionInfoForScript(v8::internal::Handle<v8::internal::String>, v8::internal::Compiler::ScriptDetails const&, v8::ScriptOriginOptions, v8::Extension*, v8::internal::ScriptData*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason, v8::internal::NativesFlag) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
11: 0x1001b7470 v8::ScriptCompiler::CompileUnboundInternal(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
12: 0x100066136 node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
13: 0x10023663f v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
14: 0x1002357db v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
15: 0x1002351f7 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/orballo/.nvm/versions/node/v10.15.3/bin/node]
16: 0xec93b85be3d 
Abort trap: 6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
luisherranzcommented, May 24, 2020
1reaction
orballocommented, May 26, 2020

I updated yesterday and while working today with v12.16.3, I still got this error:

<--- Last few GCs --->

[74056:0x102a79000]  8501440 ms: Mark-sweep 2042.5 (2053.5) -> 2041.6 (2053.5) MB, 202.2 / 0.2 ms  (average mu = 0.751, current mu = 0.000) last resort GC in old space requested
[74056:0x102a79000]  8501766 ms: Mark-sweep 2041.6 (2053.5) -> 2041.4 (2053.0) MB, 325.8 / 0.0 ms  (average mu = 0.539, current mu = 0.000) last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1009031ed]
Security context: 0x17ca4aac08d1 <JSObject>
    1: slice [0x17ca40c08791] [buffer.js:~603] [pc=0x20bdc5922f46](this=0x17ca40c07d99 <Object map = 0x17caa43e5059>,0x17cafc879229 <Uint8Array map = 0x17caa43e4569>,0,245520)
    2: toString [0x17ca2826fba9] [buffer.js:800] [bytecode=0x17ca498d5211 offset=168](this=0x17cafc879229 <Uint8Array map = 0x17caa43e4569>,0x17ca28268451 <String[#4]: utf8>,0,245520)
   ...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x1010285f9 node::Abort() (.cold.1) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 2: 0x10008634d node::FatalError(char const*, char const*) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 3: 0x10008648e node::OnFatalError(char const*, char const*) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 4: 0x100187c07 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 5: 0x100187ba7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 6: 0x100315955 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 7: 0x10031d9fc v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 8: 0x1002ed7db v8::internal::Factory::NewRawTwoByteString(int, v8::internal::AllocationType) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
 9: 0x1002ed746 v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const> const&, v8::internal::AllocationType) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
10: 0x1001aa612 v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
11: 0x100116221 node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding, v8::Local<v8::Value>*) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
12: 0x10006da96 void node::Buffer::(anonymous namespace)::StringSlice<(node::encoding)1>(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
13: 0x1009031ed Builtins_CallApiCallback [/Users/orballo/.nvm/versions/node/v12.16.3/bin/node]
Abort trap: 6
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix JavaScript Heap Out of Memory Error - MakeUseOf
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 - Snyk Support
This generally occurs on larger projects where the default amount of memory allocated by Node (1.5gb) is insufficient to complete the command successfully....
Read more >
Node.js heap out of memory - javascript - Stack Overflow
I have a 64-bit CPU and I've installed x86 node version, which caused the CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory ......
Read more >
JavaScript Heap Out Of Memory Error - OpenReplay Blog
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 >
JavaScript Heap Out of Memory - Position Is Everything
JavaScript heap out of memory is a common issue that occurs when there are a lot of processes happening concurrently. The default JavaScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found