]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Print the memory context when printing overmem limits
authorOndřej Surý <ondrej@isc.org>
Mon, 23 Jun 2025 05:48:36 +0000 (07:48 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 9 Jul 2025 19:22:48 +0000 (21:22 +0200)
When printing the memory context going into or out of the overmem
condition, also print the memory context name for easier debugging.

lib/isc/mem.c

index 9c0fd5657a06edf47161b171b790d6f2c0d7f353..e794453dd70a4cae2153acc3b0c5174e4ad96323 100644 (file)
@@ -845,8 +845,8 @@ isc_mem_isovermem(isc_mem_t *ctx) {
 
                if ((isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0) {
                        fprintf(stderr,
-                               "overmem mctx %p inuse %zu hi_water %zu\n", ctx,
-                               inuse, hiwater);
+                               "overmem %s mctx %p inuse %zu hi_water %zu\n",
+                               ctx->name, ctx, inuse, hiwater);
                }
 
                atomic_store_relaxed(&ctx->stat[tid].is_overmem, true);
@@ -865,8 +865,8 @@ isc_mem_isovermem(isc_mem_t *ctx) {
 
                if ((isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0) {
                        fprintf(stderr,
-                               "overmem mctx %p inuse %zu lo_water %zu\n", ctx,
-                               inuse, lowater);
+                               "overmem %s mctx %p inuse %zu lo_water %zu\n",
+                               ctx->name, ctx, inuse, lowater);
                }
                atomic_store_relaxed(&ctx->stat[tid].is_overmem, false);
                return false;