Node js build heap out of memory #4994
Unanswered
lf1029698952
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Version
10.24.1
Platform
Linux 4.14.134 #1 SMP Tue Jul 30 16:30:11 CST 2019 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
gulp、gulp-rev-collector
What steps will reproduce the bug?
node gulp.js build,but --max-old-space-size does't work.
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
node gulp.js build
heap out of memory
What do you see instead?
[16:49:40] Starting 'html'...
<--- Last few GCs --->
[32496:0x2c4aa40] 131841 ms: Mark-sweep 171.3 (223.2) -> 171.3 (191.7) MB, 45.7 / 0.0 ms (average mu = 0.773, current mu = 0.205) last resort GC in old space requested
[32496:0x2c4aa40] 131896 ms: Mark-sweep 171.3 (191.7) -> 171.3 (191.7) MB, 55.0 / 0.0 ms (average mu = 0.602, current mu = 0.001) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x1feba1e9e6c1
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0x8fb090 node::Abort() [gulp]
2: 0x8fb0dc [gulp]
3: 0xb033ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [gulp]
4: 0xb035e4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [gulp]
5: 0xef7642 [gulp]
6: 0xf06e5f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [gulp]
7: 0xeda640 v8::internal::Factory::NewCode(v8::internal::CodeDesc const&, v8::internal::Code::Kind, v8::internal::Handlev8::internal::Object, int, v8::internal::MaybeHandlev8::internal::ByteArray, v8::internal::MaybeHandlev8::internal::DeoptimizationData, v8::internal::Movability, unsigned int, bool, int, int, int) [gulp]
8: 0x12e8ec4 v8::internal::RegExpMacroAssemblerX64::GetCode(v8::internal::Handlev8::internal::String) [gulp]
9: 0x11083ec v8::internal::RegExpCompiler::Assemble(v8::internal::RegExpMacroAssembler*, v8::internal::RegExpNode*, int, v8::internal::Handlev8::internal::String) [gulp]
10: 0x110be14 v8::internal::RegExpEngine::Compile(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::RegExpCompileData*, v8::base::Flags<v8::internal::JSRegExp::Flag, int>, v8::internal::Handlev8::internal::String, v8::internal::Handlev8::internal::String, bool) [gulp]
11: 0x110c22b v8::internal::RegExpImpl::CompileIrregexp(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String, bool) [gulp]
12: 0x110c512 v8::internal::RegExpImpl::IrregexpPrepare(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String) [gulp]
13: 0x110c927 v8::internal::RegExpImpl::IrregexpExec(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String, int, v8::internal::Handlev8::internal::RegExpMatchInfo) [gulp]
14: 0x110caa2 v8::internal::RegExpImpl::Exec(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String, int, v8::internal::Handlev8::internal::RegExpMatchInfo) [gulp]
15: 0x11a9252 v8::internal::Runtime_RegExpExec(int, v8::internal::Object**, v8::internal::Isolate*) [gulp]
16: 0x389f2945be1d
sh: line 1: 32496 Aborted (core dumped) gulp build
Additional information
when I increase --max-old-space-size=8192 and exec:
node --max-old-space-size=8192 --initial-old-space-size=8192 --max-semi-space-size=4096 --min-semi-space-size=2048 --trace-gc --trace-gc-nvp --trace-gc-verbose ./node_modules/gulp/bin/gulp.js build
and trace gc log:
[13441:0x3f83d30] Fast promotion mode: false survival rate: 0%
[13441:0x3f83d30] 137191 ms: Heap growing factor 4.0 based on mu=0.970, speed_ratio=17 (gc=508945, mutator=30456)
[13441:0x3f83d30] 137191 ms: Grow: old size: 175843 KB, new limit: 2765708 KB (4.0)
[13441:0x3f83d30] 137191 ms: pause=73.1 mutator=15.5 gc=ms reduce_memory=0 heap.prologue=0.00 heap.epilogue=0.00 heap.epilogue.reduce_new_space=0.00 heap.external.prologue=0.0 heap.external.epilogue=0.0 heap.external.weak_global_handles=0.0 clear=1 clear.dependent_code=0.0 clear.maps=0.0 clear.slots_buffer=0.0 clear.store_buffer=0.0 clear.string_table=0.2 clear.weak_cells=0.0 clear.weak_collections=0.0 clear.weak_lists=0.2 clear.weak_references=0.1 epilogue=0.0 evacuate=12.9 evacuate.candidates=0.0 evacuate.clean_up=0.0 evacuate.copy=0.0 evacuate.prologue=10.2 evacuate.epilogue=0.0 evacuate.rebalance=2.4 evacuate.update_pointers=0.3 evacuate.update_pointers.to_new_roots=0.1 evacuate.update_pointers.slots.main=0.2 evacuate.update_pointers.slots.map_space=0.1 evacuate.update_pointers.weak=0.0 finish=0.0 mark=56.8 mark.finish_incremental=0.0 mark.roots=0.2 mark.main=56.6 mark.weak_closure=0.0 mark.weak_closure.ephemeral=0.0 mark.weak_closure.weak_handles=0.0 mark.weak_closure.weak_roots=0.0 mark.weak_closure.harmony=0.0 mark.wrapper_prologue=0.0 mark.wrapper_epilogue=0.0 mark.wrapper_tracing=0.0 prologue=0.1 sweep=0.1 sweep.code=0.1 sweep.map=0.0 sweep.old=0.0 incremental=0.0 incremental.finalize=0.0 incremental.finalize.body=0.0 incremental.finalize.external.prologue=0.0 incremental.finalize.external.epilogue=0.0 incremental.sweeping=0.0 incremental.wrapper_prologue=0.0 incremental.wrapper_tracing=0.0 incremental_wrapper_tracing_longest_step=0.0 incremental_finalize_longest_step=0.0 incremental_finalize_steps_count=0 incremental_longest_step=0.0 incremental_steps_count=0 incremental_marking_throughput=535056 incremental_walltime_duration=0 background.mark=139.2 background.sweep=23.6 background.evacuate.copy=0.0 background.evacuate.update_pointers=0.2 background.array_buffer_free=0.00 background.store_buffer=0.00 background.unmapper=0.0 total_size_before=180063248 total_size_after=180063248 holes_size_before=13517704 holes_size_after=39336 allocated=0 promoted=0 semi_space_copied=0 nodes_died_in_new=0 nodes_copied_in_new=0 nodes_promoted=0 promotion_ratio=96.1% average_survival_ratio=17.0% promotion_rate=100.0% semi_space_copy_rate=0.0% new_space_allocation_throughput=282996.4 unmapper_chunks=0 context_disposal_rate=0.0 compaction_speed=48959
[13441:0x3f83d30] Memory allocator, used: 4393668 KB, available: 12667196 KB
[13441:0x3f83d30] Read-only space, used: 34 KB, available: 469 KB, committed: 512 KB
[13441:0x3f83d30] New space, used: 0 KB, available: 2062336 KB, committed: 4194304 KB
[13441:0x3f83d30] Old space, used: 49537 KB, available: 0 KB, committed: 55524 KB
[13441:0x3f83d30] Code space, used: 121458 KB, available: 0 KB, committed: 129432KB
[13441:0x3f83d30] Map space, used: 978 KB, available: 0 KB, committed: 8716 KB
[13441:0x3f83d30] Large object space, used: 3833 KB, available: 12666675 KB, committed: 5180 KB
[13441:0x3f83d30] All spaces, used: 175843 KB, available: 14729480 KB, committed: 4393668KB
[13441:0x3f83d30] External memory reported: 1950 KB
[13441:0x3f83d30] External memory global 0 KB
[13441:0x3f83d30] Total time spent in GC : 1855.5 ms
[13441:0x3f83d30] Fast promotion mode: false survival rate: 0%
[13441:0x3f83d30] 137342 ms: Heap growing factor 4.0 based on mu=0.970, speed_ratio=17 (gc=508945, mutator=30373)
[13441:0x3f83d30] 137342 ms: Grow: old size: 175836 KB, new limit: 2255756 KB (1.1)
[13441:0x3f83d30] 137344 ms: pause=138.0 mutator=14.6 gc=ms reduce_memory=1 heap.prologue=0.00 heap.epilogue=2.03 heap.epilogue.reduce_new_space=2.02 heap.external.prologue=0.0 heap.external.epilogue=0.0 heap.external.weak_global_handles=0.0 clear=1 clear.dependent_code=0.0 clear.maps=0.0 clear.slots_buffer=0.0 clear.store_buffer=0.0 clear.string_table=0.4 clear.weak_cells=0.0 clear.weak_collections=0.0 clear.weak_lists=0.2 clear.weak_references=0.1 epilogue=0.0 evacuate=77.4 evacuate.candidates=0.0 evacuate.clean_up=0.0 evacuate.copy=59.8 evacuate.prologue=9.5 evacuate.epilogue=0.0 evacuate.rebalance=3.9 evacuate.update_pointers=4.1 evacuate.update_pointers.to_new_roots=0.1 evacuate.update_pointers.slots.main=3.8 evacuate.update_pointers.slots.map_space=0.1 evacuate.update_pointers.weak=0.0 finish=0.0 mark=51.4 mark.finish_incremental=0.0 mark.roots=0.2 mark.main=51.2 mark.weak_closure=0.0 mark.weak_closure.ephemeral=0.0 mark.weak_closure.weak_handles=0.0 mark.weak_closure.weak_roots=0.0 mark.weak_closure.harmony=0.0 mark.wrapper_prologue=0.0 mark.wrapper_epilogue=0.0 mark.wrapper_tracing=0.0 prologue=0.1 sweep=0.1 sweep.code=0.1 sweep.map=0.0 sweep.old=0.0 incremental=0.0 incremental.finalize=0.0 incremental.finalize.body=0.0 incremental.finalize.external.prologue=0.0 incremental.finalize.external.epilogue=0.0 incremental.sweeping=0.0 incremental.wrapper_prologue=0.0 incremental.wrapper_tracing=0.0 incremental_wrapper_tracing_longest_step=0.0 incremental_finalize_longest_step=0.0 incremental_finalize_steps_count=0 incremental_longest_step=0.0 incremental_steps_count=0 incremental_marking_throughput=535056 incremental_walltime_duration=0 background.mark=120.7 background.sweep=38.1 background.evacuate.copy=286.6 background.evacuate.update_pointers=17.3 background.array_buffer_free=0.00 background.store_buffer=0.00 background.unmapper=1.9 total_size_before=180063248 total_size_after=180056928 holes_size_before=13517704 holes_size_after=4051064 allocated=0 promoted=0 semi_space_copied=0 nodes_died_in_new=0 nodes_copied_in_new=0 nodes_promoted=0 promotion_ratio=96.1% average_survival_ratio=17.0% promotion_rate=100.0% semi_space_copy_rate=0.0% new_space_allocation_throughput=261883.6 unmapper_chunks=4095 context_disposal_rate=0.0 compaction_speed=43927
[13441:0x3f83d30] Memory allocator, used: 2296516 KB, available: 14764348 KB
[13441:0x3f83d30] Read-only space, used: 34 KB, available: 469 KB, committed: 512 KB
[13441:0x3f83d30] New space, used: 0 KB, available: 2062336 KB, committed: 2097152 KB
[13441:0x3f83d30] Old space, used: 49531 KB, available: 3817 KB, committed: 55524 KB
[13441:0x3f83d30] Code space, used: 121458 KB, available: 0 KB, committed: 129432KB
[13441:0x3f83d30] Map space, used: 978 KB, available: 0 KB, committed: 8716 KB
[13441:0x3f83d30] Large object space, used: 3833 KB, available: 14763827 KB, committed: 5180 KB
[13441:0x3f83d30] All spaces, used: 175836 KB, available: 16830450 KB, committed: 2296516KB
[13441:0x3f83d30] External memory reported: 1950 KB
[13441:0x3f83d30] External memory global 0 KB
[13441:0x3f83d30] Total time spent in GC : 1993.5 ms
[13441:0x3f83d30] Fast promotion mode: false survival rate: 0%
[13441:0x3f83d30] 137695 ms: Heap growing factor 4.0 based on mu=0.970, speed_ratio=17 (gc=508945, mutator=30370)
[13441:0x3f83d30] 137695 ms: Grow: old size: 175836 KB, new limit: 2255756 KB (1.1)
[13441:0x3f83d30] 137697 ms: pause=353.1 mutator=0.4 gc=ms reduce_memory=1 heap.prologue=0.00 heap.epilogue=1.99 heap.epilogue.reduce_new_space=1.98 heap.external.prologue=0.0 heap.external.epilogue=0.0 heap.external.weak_global_handles=0.0 clear=1 clear.dependent_code=0.0 clear.maps=0.1 clear.slots_buffer=0.0 clear.store_buffer=0.0 clear.string_table=0.3 clear.weak_cells=0.0 clear.weak_collections=0.0 clear.weak_lists=0.2 clear.weak_references=0.1 epilogue=0.0 evacuate=31.1 evacuate.candidates=0.0 evacuate.clean_up=0.0 evacuate.copy=15.9 evacuate.prologue=10.2 evacuate.epilogue=0.0 evacuate.rebalance=3.3 evacuate.update_pointers=1.8 evacuate.update_pointers.to_new_roots=0.1 evacuate.update_pointers.slots.main=1.5 evacuate.update_pointers.slots.map_space=0.1 evacuate.update_pointers.weak=0.0 finish=0.1 mark=52.7 mark.finish_incremental=0.0 mark.roots=0.2 mark.main=52.5 mark.weak_closure=0.0 mark.weak_closure.ephemeral=0.0 mark.weak_closure.weak_handles=0.0 mark.weak_closure.weak_roots=0.0 mark.weak_closure.harmony=0.0 mark.wrapper_prologue=0.0 mark.wrapper_epilogue=0.0 mark.wrapper_tracing=0.0 prologue=0.1 sweep=0.1 sweep.code=0.1 sweep.map=0.0 sweep.old=0.0 incremental=0.0 incremental.finalize=0.0 incremental.finalize.body=0.0 incremental.finalize.external.prologue=0.0 incremental.finalize.external.epilogue=0.0 incremental.sweeping=0.0 incremental.wrapper_prologue=0.0 incremental.wrapper_tracing=0.0 incremental_wrapper_tracing_longest_step=0.0 incremental_finalize_longest_step=0.0 incremental_finalize_steps_count=0 incremental_longest_step=0.0 incremental_steps_count=0 incremental_marking_throughput=535056 incremental_walltime_duration=0 background.mark=112.7 background.sweep=0.0 background.evacuate.copy=57.8 background.evacuate.update_pointers=6.0 background.array_buffer_free=0.00 background.store_buffer=0.00 background.unmapper=248.8 total_size_before=180056928 total_size_after=180056928 holes_size_before=4051064 holes_size_after=2272120 allocated=0 promoted=0 semi_space_copied=0 nodes_died_in_new=0 nodes_copied_in_new=0 nodes_promoted=0 promotion_ratio=96.1% average_survival_ratio=17.0% promotion_rate=100.0% semi_space_copy_rate=0.0% new_space_allocation_throughput=227880.4 unmapper_chunks=4096 context_disposal_rate=0.0 compaction_speed=13661
[13441:0x3f83d30] Memory allocator, used: 2296516 KB, available: 14764348 KB
[13441:0x3f83d30] Read-only space, used: 34 KB, available: 469 KB, committed: 512 KB
[13441:0x3f83d30] New space, used: 0 KB, available: 2062336 KB, committed: 2097152 KB
[13441:0x3f83d30] Old space, used: 49531 KB, available: 2090 KB, committed: 55524 KB
[13441:0x3f83d30] Code space, used: 121458 KB, available: 0 KB, committed: 129432KB
[13441:0x3f83d30] Map space, used: 978 KB, available: 0 KB, committed: 8716 KB
[13441:0x3f83d30] Large object space, used: 3833 KB, available: 14763827 KB, committed: 5180 KB
[13441:0x3f83d30] All spaces, used: 175836 KB, available: 16828723 KB, committed: 2296516KB
[13441:0x3f83d30] External memory reported: 1950 KB
[13441:0x3f83d30] External memory global 0 KB
[13441:0x3f83d30] Total time spent in GC : 2346.5 ms
<--- Last few GCs --->
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x0b9b1ac1e6c1
2: replace [0xb9b1ac105c1](this=0x283c12379511 <Very long string[1141]>,0x0109e0c22861 <JSRegExp <String[42]: /img/banks/boc(-[0-9a-f]{8,10}-?)?.png>>,0x0109e0c22931 <String[74]: https://static.xxxx.com/boc-aaaaaaa.png>)
3: /* anonymous /(aka / anonymous */) [0x283c123799a...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0x8fb090 node::Abort() [gulp]
2: 0x8fb0dc [gulp]
3: 0xb0336e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [gulp]
4: 0xb035a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [gulp]
5: 0xef7602 [gulp]
6: 0xf06e1f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [gulp]
7: 0xeda600 v8::internal::Factory::NewCode(v8::internal::CodeDesc const&, v8::internal::Code::Kind, v8::internal::Handlev8::internal::Object, int, v8::internal::MaybeHandlev8::internal::ByteArray, v8::internal::MaybeHandlev8::internal::DeoptimizationData, v8::internal::Movability, unsigned int, bool, int, int, int) [gulp]
8: 0x12e8e84 v8::internal::RegExpMacroAssemblerX64::GetCode(v8::internal::Handlev8::internal::String) [gulp]
9: 0x11083ac v8::internal::RegExpCompiler::Assemble(v8::internal::RegExpMacroAssembler*, v8::internal::RegExpNode*, int, v8::internal::Handlev8::internal::String) [gulp]
10: 0x110bdd4 v8::internal::RegExpEngine::Compile(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::RegExpCompileData*, v8::base::Flags<v8::internal::JSRegExp::Flag, int>, v8::internal::Handlev8::internal::String, v8::internal::Handlev8::internal::String, bool) [gulp]
11: 0x110c1eb v8::internal::RegExpImpl::CompileIrregexp(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String, bool) [gulp]
12: 0x110c4d2 v8::internal::RegExpImpl::IrregexpPrepare(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String) [gulp]
13: 0x110c8e7 v8::internal::RegExpImpl::IrregexpExec(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String, int, v8::internal::Handlev8::internal::RegExpMatchInfo) [gulp]
14: 0x110ca62 v8::internal::RegExpImpl::Exec(v8::internal::Handlev8::internal::JSRegExp, v8::internal::Handlev8::internal::String, int, v8::internal::Handlev8::internal::RegExpMatchInfo) [gulp]
15: 0x11a9212 v8::internal::Runtime_RegExpExec(int, v8::internal::Object**, v8::internal::Isolate*) [gulp]
16: 0x36aa137dbf1d
Aborted (core dumped)
Beta Was this translation helpful? Give feedback.
All reactions