From: Willy Tarreau Date: Tue, 3 Nov 2020 14:53:34 +0000 (+0100) Subject: MEDIUM: pools: call malloc_trim() from pool_gc() X-Git-Tag: v2.4-dev1~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88366c292;p=thirdparty%2Fhaproxy.git MEDIUM: pools: call malloc_trim() from pool_gc() If available it definitely makes sense to call it since it's also called when stopping to reclaim the maximum possible memory. --- diff --git a/src/pool.c b/src/pool.c index 321f8bc677..73082e8cc1 100644 --- a/src/pool.c +++ b/src/pool.c @@ -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 */