From d77df5ea606783732e9ffac2467905f313d9e912 Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Mon, 2 Mar 2026 16:52:09 -0600 Subject: [PATCH] fix: use mallinfo instead of mallinfo2 for older glibc compat the deploy target's glibc doesn't have mallinfo2 (needs 2.33+). mallinfo uses int fields (cap at 2 GiB) but sufficient for distinguishing leak vs fragmentation patterns. Co-Authored-By: Claude Opus 4.6 --- src/broadcaster.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/broadcaster.zig b/src/broadcaster.zig index 1356d33..84f9b6e 100644 --- a/src/broadcaster.zig +++ b/src/broadcaster.zig @@ -683,7 +683,9 @@ fn appendProcMetrics(w: anytype) void { } else |_| {} // glibc malloc arena stats — distinguishes in-use heap from fragmentation - const mi = malloc_h.mallinfo2(); + // uses mallinfo (not mallinfo2) for older glibc compat; int fields cap at 2 GiB + // but that's enough to distinguish leak vs fragmentation patterns + const mi = malloc_h.mallinfo(); std.fmt.format(w, \\# TYPE relay_malloc_arena_bytes gauge \\# HELP relay_malloc_arena_bytes total bytes claimed from OS by malloc -- 2.51.2