From 91de8bac22df300620ea4165e3ab1f31f8985d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= <marek.vavrusa@nic.cz> Date: Wed, 24 Jun 2015 21:22:32 +0200 Subject: [PATCH] daemon/worker: less frequent decommit --- daemon/worker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/worker.c b/daemon/worker.c index 9d93b245e..bd6d518ca 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -142,8 +142,8 @@ static void qr_task_free(uv_handle_t *handle) mp_delete(mp_context); #if defined(__GLIBC__) && defined(_GNU_SOURCE) /* Decommit memory every once in a while */ - static int mp_delete_count = 0; - if (++mp_delete_count == 2 * worker->pools.cap) { + static size_t mp_delete_count = 0; + if (++mp_delete_count == 100 * MP_FREELIST_SIZE) { malloc_trim(0); mp_delete_count = 0; } -- GitLab