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_internals.h | |
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_internals.h')
-rw-r--r-- | src/node_internals.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node_internals.h b/src/node_internals.h index aa7180e1854..f7a1e2d8d62 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -363,6 +363,10 @@ class DiagnosticFilename { std::string filename_; }; +namespace heap { +bool WriteSnapshot(v8::Isolate* isolate, const char* filename); +} + class TraceEventScope { public: TraceEventScope(const char* category, |