From 87c6e19921ae916a7af53e1695e37995aa112607 Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Tue, 8 Oct 2024 09:12:01 -0700 Subject: [PATCH] runtime: add HeapAlloc to gc_leaking --- src/runtime/gc_leaking.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime/gc_leaking.go b/src/runtime/gc_leaking.go index 5c9594277c..71c4258b67 100644 --- a/src/runtime/gc_leaking.go +++ b/src/runtime/gc_leaking.go @@ -79,6 +79,9 @@ func ReadMemStats(m *MemStats) { m.Mallocs = gcMallocs m.Frees = gcFrees m.Sys = uint64(heapEnd - heapStart) + // no free -- current in use heap is the total allocated + m.HeapAlloc = gcTotalAlloc + m.Alloc = m.HeapAlloc } func GC() {