diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2020-10-21 22:41:11 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2020-10-21 22:41:11 +0300 |
commit | d2a3078460095bef0db0772eb94a0b5d3232ec84 (patch) | |
tree | 5b0a050d43b355cc18fad698fecac0c0c809a8a9 /src/node_main_instance.cc | |
parent | d5088d8dbbcf1cdc32e15a37e132a43e95dece2f (diff) |
src: add --heapsnapshot-near-heap-limit option
This patch adds a --heapsnapshot-near-heap-limit CLI option
that takes heap snapshots when the V8 heap is approaching
the heap size limit. It will try to write the snapshots
to disk before the program crashes due to OOM.
PR-URL: https://github.com/nodejs/node/pull/33010
Refs: https://github.com/nodejs/node/issues/27552
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'src/node_main_instance.cc')
-rw-r--r-- | src/node_main_instance.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index d406bf15444..84d39831dcd 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -108,6 +108,8 @@ NodeMainInstance::NodeMainInstance( // complete. SetIsolateErrorHandlers(isolate_, s); } + isolate_data_->max_young_gen_size = + params->constraints.max_young_generation_size_in_bytes(); } void NodeMainInstance::Dispose() { |