From eee96f7f5dd2c900b471a2aa3dc46e2e59e0e097 Mon Sep 17 00:00:00 2001 From: Ilyas Shabi Date: Sun, 15 Mar 2026 15:08:02 +0100 Subject: [PATCH] worker: heap profile optimizations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/62201 Reviewed-By: Anna Henningsen Reviewed-By: Yagiz Nizipli Reviewed-By: Colin Ihrig Reviewed-By: Juan José Arboleda Reviewed-By: theanarkh Reviewed-By: Gürgün Dayıoğlu --- src/node_worker.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_worker.cc b/src/node_worker.cc index fa7dc52b191..1d07449c529 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -1121,7 +1121,8 @@ static bool serializeProfile(Isolate* isolate, std::ostringstream& out_stream) { if (!profile) { return false; } - JSONWriter writer(out_stream, false); + profiler->StopSamplingHeapProfiler(); + JSONWriter writer(out_stream, true); writer.json_start(); writer.json_arraystart("samples"); @@ -1139,7 +1140,6 @@ static bool serializeProfile(Isolate* isolate, std::ostringstream& out_stream) { writer.json_objectend(); writer.json_end(); - profiler->StopSamplingHeapProfiler(); return true; }