From 436ad8ceb9b6948cbd77d7353dcec2408d21b74b Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 12 Jun 2024 20:30:16 +0200 Subject: [PATCH] src: print v8::OOMDetails::detail when it's available This provides a bit more information when V8 runs out of memory. PR-URL: https://github.com/nodejs/node/pull/53360 Reviewed-By: Chengzhong Wu Reviewed-By: Debadree Chatterjee --- src/node_errors.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node_errors.cc b/src/node_errors.cc index ff091fd20d915b..69e474257b0427 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -598,6 +598,9 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details) { } else { FPrintF(stderr, "FATAL ERROR: %s\n", message); } + if (details.detail != nullptr) { + FPrintF(stderr, "Reason: %s\n", details.detail); + } Isolate* isolate = Isolate::TryGetCurrent(); bool report_on_fatalerror;