Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Js heap out of memory #87

Open
ghost opened this issue Mar 15, 2019 · 6 comments
Open

Js heap out of memory #87

ghost opened this issue Mar 15, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 15, 2019

Linux-Mint-18 4.15.0-46-generic # 49~16.04.1-Ubuntu
node v11.1.0
webpack@4.29.6
babel-minify-webpack-plugin@0.3.1

Uncompressed bundle size: 11.6 MiB

Prod config ony adding NODE_ENV=production, mode=production, devtool=none and babel-minfy-webpack-plugin.

Build fails with nodeJS heap out of memory.

<--- Last few GCs --->

[2430:0x36e20b0]    31857 ms: Mark-sweep 1386.4 (1424.2) -> 1386.1 (1423.2) MB, 624.2 / 0.0 ms  (average mu = 0.102, current mu = 0.028) allocation failure scavenge might not succeed
[2430:0x36e20b0]    31862 ms: Scavenge 1386.7 (1423.2) -> 1386.4 (1423.7) MB, 3.2 / 0.0 ms  (average mu = 0.102, current mu = 0.028) allocation failure 
[2430:0x36e20b0]    31866 ms: Scavenge 1387.1 (1423.7) -> 1386.7 (1424.7) MB, 2.7 / 0.0 ms  (average mu = 0.102, current mu = 0.028) allocation failure 


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0xbe4ab44fb5d]
Security context: 0x32d12dc1d949 <JSObject>
    1: invariant(aka invariant) [0x2a7d8fff0059] [/home/user/myProj/website/node_modules/invariant/invariant.js:~23] [pc=0xbe4abdfb701](this=0x2bb13e8025b1 <undefined>,0x2b0768234d29 <Node map = 0x1505b3ff9581>,0x29361ebfa511 <String[44]: To get a node path the parent needs to exist>,0x2bb13e8025b1 <undefined>,0x2bb13e8025b1 <undefined>,0x2...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x90db20 node::Abort() [node]
 2: 0x90db6c  [node]
 3: 0xb0702e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb07264 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xf03592  [node]
 6: 0xf03698 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xf0fdb8 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xf108cb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf13601 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xedd834 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
11: 0x119300e v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0xbe4ab44fb5d 
Aborted

@etagwerker
Copy link

I can confirm that this error is happening to me too:

Compiling…
Compilation failed:
[BABEL] Note: The code generator has deoptimised the styling of /home/app/src/node_modules/nitro-storybook/fonts/regular.js as it exceeds the max of 500KB.
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [node]
 2: 0x121a2cc [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::Factory::NewTransitionArray(int) [node]
 6: 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) [node]
 7: 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) [node]
 8: v8::internal::Map::CopyAddDescriptor(v8::internal::Handle<v8::internal::Map>, v8::internal::Descriptor*, v8::internal::TransitionFlag) [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::PropertyConstness, v8::internal::Object::StoreFromKeyed) [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) [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) [node]
12: v8::internal::JSObject::DefineOwnPropertyIgnoreAttributes(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::JSObject::AccessorInfoHandling) [node]
13: v8::internal::Runtime_DefineDataPropertyInLiteral(int, v8::internal::Object**, v8::internal::Isolate*) [node]
14: 0x1ca20620463d


<--- Last few GCs --->

[137:0x41bda90]  1468904 ms: Mark-sweep 1410.7 (1537.9) -> 1410.7 (1536.9) MB, 6593.3 / 0.1 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 6593 ms) last resort GC in old space requested
[137:0x41bda90]  1474602 ms: Mark-sweep 1410.7 (1536.9) -> 1410.7 (1536.9) MB, 5697.2 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x9a4fd2a5ee1 <JSObject>
    2: from [native array.js:1] [bytecode=0x14af8cd8f419 offset=116](this=0x9a4fd285519 <JSFunction Array (sfi = 0x1e01bc927809)>,arrayLike=0x2be2b24fffe1 <Set map = 0x180e72184eb1>,mapfn=0x1e01bc902311 <undefined>,receiver=0x1e01bc902311 <undefined>)
    3: arguments adaptor frame: 1->3
    4: hasEval(aka hasEval) [/home/app/src/node_modules/babel-helper-mark-eval-scopes/lib/index.js:~53] [pc=0x...


script returned exit code 1

So I don't think it's an isolated incident.

@dractw
Copy link

dractw commented Apr 12, 2019

Bump the same issue

@alexander-akait
Copy link
Member

alexander-akait commented Apr 12, 2019

Leak in babel inside babel-helper-mark-eval-scopes

@poseidonphp
Copy link

Is there something i can do in my environment to fix this? Or does it need to be fixed in the babel package? If it's out of my control, is there an ETA for an available fix/patch?

@apurvapunde
Copy link

i am also facing this issue, please help

@dmt0
Copy link

dmt0 commented Oct 29, 2019

Build worked for me using NODE_OPTIONS="--max-old-space-size=4096" environment variable, even though it took excruciatingly long time. Setting it to a higher value doesn't seem to help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants