aboutsummaryrefslogtreecommitdiffstats
path: root/src/arena.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-12-08 12:13:50 -0800
committerQi Wang <interwq@gmail.com>2017-12-18 12:57:07 -0800
commit740bdd68b1d4b9c39c68432e06deb70ad4da3210 (patch)
tree0424df6e414f9e5c03fa50623572da38955b18ca /src/arena.c
parentf70785de91ee14e8034f9bd64bf6590199c89e65 (diff)
downloadplatform_external_jemalloc_new-740bdd68b1d4b9c39c68432e06deb70ad4da3210.tar.gz
platform_external_jemalloc_new-740bdd68b1d4b9c39c68432e06deb70ad4da3210.tar.bz2
platform_external_jemalloc_new-740bdd68b1d4b9c39c68432e06deb70ad4da3210.zip
Over purge by 1 extent always.
When purging, large allocations are usually the ones that cross the npages_limit threshold, simply because they are "large". This means we often leave the large extent around for a while, which has the downsides of: 1) high RSS and 2) more chance of them getting fragmented. Given that they are not likely to be reused very soon (LRU), let's over purge by 1 extent (which is often large and not reused frequently).
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arena.c b/src/arena.c
index e2462bf7..a28dbfb0 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -912,7 +912,7 @@ arena_stash_decayed(tsdn_t *tsdn, arena_t *arena,
extent_t *extent;
while (nstashed < npages_decay_max &&
(extent = extents_evict(tsdn, arena, r_extent_hooks, extents,
- npages_limit, npages_decay_max - nstashed)) != NULL) {
+ npages_limit)) != NULL) {
extent_list_append(decay_extents, extent);
nstashed += extent_size_get(extent) >> LG_PAGE;
}
@@ -1226,7 +1226,7 @@ arena_destroy_retained(tsdn_t *tsdn, arena_t *arena) {
extent_hooks_t *extent_hooks = extent_hooks_get(arena);
extent_t *extent;
while ((extent = extents_evict(tsdn, arena, &extent_hooks,
- &arena->extents_retained, 0, SIZE_MAX)) != NULL) {
+ &arena->extents_retained, 0)) != NULL) {
extent_destroy_wrapper(tsdn, arena, &extent_hooks, extent);
}
}