]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] memory_stat: per-worker memory dump collector
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 2 May 2026 14:28:05 +0000 (15:28 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 2 May 2026 14:28:05 +0000 (15:28 +0100)
commitd18547ea21121ebec9b94160f68ab034d92ae965
treea334c401ccff67011c7f9f3409face25024bbf44
parentebc17255650cbb62aadf3d9d57d38a57493887f4
[Feature] memory_stat: per-worker memory dump collector

Introduce src/libserver/memory_stat.{cxx,h} that gathers a UCL dump for
a worker process: OS-level RSS/VmSize breakdown, mempool aggregate plus
per-callsite suggestions, Lua heap usage, and (when WITH_JEMALLOC is
defined) jemalloc mallctl counters and the textual malloc_stats_print
dump. The document is serialized to a tempfile and the descriptor is
passed back over the control pipe with SCM_RIGHTS, mirroring the
existing fuzzy_stat pattern.

Wire the collector into rspamd_control_default_cmd_handler so any
worker registered with the default control handlers transparently
answers RSPAMD_CONTROL_MEMORY_STAT without per-worker boilerplate.
src/libserver/CMakeLists.txt
src/libserver/memory_stat.cxx [new file with mode: 0644]
src/libserver/memory_stat.h [new file with mode: 0644]
src/libserver/rspamd_control.c