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.

JavaScript heap out of memory

See original GitHub issue

I am using this in a medium large React project as part of the Webpack flow. For compression we are using the Babili-Webpack-Plugin. As this is just a small wrapper around Babili I figure the following issue is more related to Babili itself:


<--- Last few GCs --->

  344958 ms: Mark-sweep 1324.0 (1434.9) -> 1324.0 (1434.9) MB, 1946.1 / 0.0 ms [allocation failure] [GC in old space requested].
  346872 ms: Mark-sweep 1324.0 (1434.9) -> 1324.0 (1434.9) MB, 1913.9 / 0.0 ms [allocation failure] [GC in old space requested].
  348780 ms: Mark-sweep 1324.0 (1434.9) -> 1327.8 (1405.9) MB, 1907.5 / 0.0 ms [last resort gc].
  350727 ms: Mark-sweep 1327.8 (1405.9) -> 1331.7 (1405.9) MB, 1946.7 / 0.0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x381e5ffcfb51 <JS Object>
    1: visitQueue [/workspace/1_ui/ui-foundation/node_modules/babel-traverse/lib/context.js:~114] [pc=0x35f210c516c7] (this=0x2bf0d5c576b9 <a TraversalContext with map 0x22808a4e239>,queue=0x2bf0d5c57701 <JS Array[1]>)
    2: node [/workspace/1_ui/ui-foundation/node_modules/babel-traverse/lib/index.js:~94] [pc=0x35f210cf29bc] (...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [/usr/local/bin/node]
 4: v8::Utils::ApiCheck(bool, char const*, char const*) [/usr/local/bin/node]
 5: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 6: v8::internal::Factory::NewByteArray(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 7: v8::internal::Factory::NewCode(v8::internal::CodeDesc const&, unsigned int, v8::internal::Handle<v8::internal::Object>, bool, bool, int, bool) [/usr/local/bin/node]
 8: v8::internal::PropertyAccessCompiler::GetCodeWithFlags(unsigned int, char const*) [/usr/local/bin/node]
 9: v8::internal::PropertyHandlerCompiler::GetCode(v8::internal::Code::Kind, v8::internal::Code::StubType, v8::internal::Handle<v8::internal::Name>) [/usr/local/bin/node]
10: v8::internal::NamedLoadHandlerCompiler::CompileLoadNonexistent(v8::internal::Handle<v8::internal::Name>) [/usr/local/bin/node]
11: v8::internal::NamedLoadHandlerCompiler::ComputeLoadNonexistent(v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Map>) [/usr/local/bin/node]
12: v8::internal::LoadIC::UpdateCaches(v8::internal::LookupIterator*) [/usr/local/bin/node]
13: v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>) [/usr/local/bin/node]
14: v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
15: 0x35f20b8092a7
Abort trap: 6

These are the relevant software versions:

  • Mac OS Sierra
  • Node 6.9.2
  • Babili Preset 0.0.9
  • Babel Core 6.18.2
  • Babel Traverse 6.19.0

Is there anything I can do to debug this anymore?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:25
  • Comments:40 (8 by maintainers)

github_iconTop GitHub Comments

23reactions
yocontracommented, Jul 21, 2017

Still getting the same issue as of July/August - disabling mangle didn’t help.

<--- Last few GCs --->

[24150:0x102801600]   126688 ms: Mark-sweep 1403.4 (1490.7) -> 1403.2 (1459.7) MB, 2206.9 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2207 ms) last resort
[24150:0x102801600]   128938 ms: Mark-sweep 1403.2 (1459.7) -> 1403.2 (1459.7) MB, 2249.9 / 0.0 ms  last resort


<--- JS stacktrace --->

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

Security context: 0xd18d03a66a1 <JS Object>
    1: getBindingIdentifiers [/Users/contra/Projects/staeco/node_modules/babili-webpack-plugin/node_modules/babel-types/lib/retrievers.js:~20] [pc=0x10c73d68fe4e](this=0x26c47a909239 <an Object with map 0x2405980dddd1>,node=0x2c5b756e2ad9 <a Node with map 0x52ecb9d1f61>,duplicates=0x3363d09023b1 <true>,outerOnly=0x3363d0902311 <undefined>)
    2: arguments adaptor frame: 2->3
    3: registerBind...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 4: v8::internal::Factory::NewTransitionArray(int) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 5: v8::internal::TransitionArray::Insert(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Map>, v8::internal::SimpleTransitionFlag) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 6: v8::internal::Map::CopyReplaceDescriptors(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::DescriptorArray>, v8::internal::Handle<v8::internal::LayoutDescriptor>, v8::internal::TransitionFlag, v8::internal::MaybeHandle<v8::internal::Name>, char const*, v8::internal::SimpleTransitionFlag) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 7: v8::internal::Map::CopyAddDescriptor(v8::internal::Handle<v8::internal::Map>, v8::internal::Descriptor*, v8::internal::TransitionFlag) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 8: v8::internal::Map::CopyWithField(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::FieldType>, v8::internal::PropertyAttributes, v8::internal::Representation, v8::internal::TransitionFlag) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
 9: v8::internal::Map::TransitionToDataProperty(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
10: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
11: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
12: v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
13: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/contra/.nvm/versions/node/v7.10.0/bin/node]
14: 0x10c73c5043a7
6reactions
joseSantacruzcommented, Apr 17, 2017

same issue here

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 >
Node.js heap out of memory - 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 - 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 >
How to solve JavaScript heap out of memory error
To fix JavaScript heap out of memory error, you need to add the --max-old-space-size option when running your npm command. ... Alternatively, you ......
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 >

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