From ef9700816fd2bd521bab837ccd85e0a596aa3aa8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 11 Mar 2021 08:39:41 +0000 Subject: malloc_trim is itself very poor and gets slower and slower as the heap becomes more fragmented. Run it only once an hour. GitHub issue 2551. --- server.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server.c') diff --git a/server.c b/server.c index ab8c6574..0b878d9e 100644 --- a/server.c +++ b/server.c @@ -159,6 +159,10 @@ server_tidy_event(__unused int fd, __unused short events, __unused void *data) format_tidy_jobs(); +#ifdef HAVE_MALLOC_TRIM + malloc_trim(0); +#endif + log_debug("%s: took %llu milliseconds", __func__, get_timer() - t); evtimer_add(&server_ev_tidy, &tv); } -- cgit