]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker: trim on pool rollover
authorMarek Vavruša <marek.vavrusa@nic.cz>
Mon, 22 Jun 2015 17:13:40 +0000 (19:13 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Mon, 22 Jun 2015 17:13:40 +0000 (19:13 +0200)
daemon/worker.c

index da4be1a459e1530896352b23756f9a3258d975bb..9d93b245ed7b3374eb932b7852ba5868f0e1cd5e 100644 (file)
@@ -143,7 +143,7 @@ static void qr_task_free(uv_handle_t *handle)
 #if defined(__GLIBC__) && defined(_GNU_SOURCE)
                /* Decommit memory every once in a while */
                static int mp_delete_count = 0;
-               if (++mp_delete_count == 1000) {
+               if (++mp_delete_count == 2 * worker->pools.cap) {
                        malloc_trim(0);
                        mp_delete_count = 0;
                }