From 88366c2926deac5ee257b6c541633b6a8b5111b3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 3 Nov 2020 15:53:34 +0100 Subject: [PATCH] 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. --- src/pool.c | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- 2.39.5