mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-05 21:11:53 +00:00
MEDIUM: pattern: call malloc_trim() on pat_ref_reload()
This is one case where we may release large amounts of data at once. Tests show that without this, after 10 full reloads of an ACL containing 1M IP addresses, the memory usage grew and stabilized around 1.7 GB of RSS. With this change, it stays around 260 MB and is stable across reloads.
This commit is contained in:
parent
88366c2926
commit
114d698fde
@ -2101,6 +2101,10 @@ void pat_ref_reload(struct pat_ref *ref, struct pat_ref *replace)
|
||||
HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &expr->lock);
|
||||
}
|
||||
HA_SPIN_UNLOCK(PATREF_LOCK, &ref->lock);
|
||||
|
||||
#if defined(HA_HAVE_MALLOC_TRIM)
|
||||
malloc_trim(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This function prunes all entries of <ref>. This function
|
||||
|
Loading…
Reference in New Issue
Block a user