From fb1058cfceed75f7622477c8289caf287a1b3fba Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 3 Feb 2026 13:45:21 +0100 Subject: [PATCH] fix(heap): release OOM profile after callback If a OOM profile is created, it would not released afterwards increasing the likelihood of not being able to recover, if there is any chance for that. --- bindings/profilers/heap.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bindings/profilers/heap.cc b/bindings/profilers/heap.cc index fa81f742..a577b7fb 100644 --- a/bindings/profilers/heap.cc +++ b/bindings/profilers/heap.cc @@ -661,6 +661,8 @@ void InterruptCallback(v8::Isolate* isolate, void* data) { dd::TranslateAllocationProfile(state->profile.get())}; Nan::AsyncResource resource("NearHeapLimit"); state->callback.Call(1, argv, &resource); + // Release the retained native profile once the callback has been invoked. + state->profile.reset(); } void AsyncCallback(uv_async_t* handle) {