aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-05-10 17:40:39 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-05-10 17:40:39 +0100
commitb218ec15bdae237f5ec9f23821239c29e2d3757d (patch)
tree8c4ccd4c745c7590497e44cc3b16832b2a4657cb /src/libserver/task.c
parentbc8a0fe1d5f55e6ec47200028a027d1843d6306d (diff)
downloadrspamd-b218ec15bdae237f5ec9f23821239c29e2d3757d.tar.gz
rspamd-b218ec15bdae237f5ec9f23821239c29e2d3757d.zip
[Minor] Allow to tune GC related options
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r--src/libserver/task.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index abe8143bc..a7c1bc478 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -242,7 +242,6 @@ rspamd_task_free (struct rspamd_task *task)
struct rspamd_email_address *addr;
struct rspamd_lua_cached_entry *entry;
static guint free_iters = 0;
- const guint free_iters_limit = 5000;
GHashTableIter it;
gpointer k, v;
guint i;
@@ -351,7 +350,7 @@ rspamd_task_free (struct rspamd_task *task)
g_hash_table_unref (task->lua_cache);
}
- if (++free_iters > free_iters_limit) {
+ if (task->cfg->full_gc_iters && (++free_iters > task->cfg->full_gc_iters)) {
/* Perform more expensive cleanup cycle */
gsize allocated = 0, active = 0, metadata = 0,
resident = 0, mapped = 0, old_lua_mem = 0;
@@ -381,7 +380,8 @@ rspamd_task_free (struct rspamd_task *task)
allocated, active, metadata, resident, mapped,
old_lua_mem, lua_gc (task->cfg->lua_state, LUA_GCCOUNT, 0),
(t2 - t1) * 1000.0);
- free_iters = rspamd_time_jitter (0, (gdouble)free_iters_limit / 2);
+ free_iters = rspamd_time_jitter (0,
+ (gdouble)task->cfg->full_gc_iters / 2);
}
REF_RELEASE (task->cfg);