From 5a19a9bd2616280d4a1a71da653cdf5f1ab57fde 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 b055c1e70dbf60..65f95c3157add2 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -600,6 +600,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;