]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: pools: call malloc_trim() from pool_gc()
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2020 14:53:34 +0000 (15:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Nov 2020 18:27:08 +0000 (19:27 +0100)
If available it definitely makes sense to call it since it's also
called when stopping to reclaim the maximum possible memory.

src/pool.c

index 321f8bc677f7addd45a685e03dadcd399bff4ae6..73082e8cc1857a7d8de0a59a33fc71e806dc0e78 100644 (file)
@@ -303,6 +303,10 @@ void pool_gc(struct pool_head *pool_ctx)
 
        if (!isolated)
                thread_release();
+
+#if defined(HA_HAVE_MALLOC_TRIM)
+       malloc_trim(0);
+#endif
 }
 
 #else /* CONFIG_HAP_LOCKLESS_POOLS */