Skip to content

Commit

Permalink
malloc_trim with the slab size after shrinkage actually frees the mem…
Browse files Browse the repository at this point in the history
…ory to the system, even in cases of large caches and small releases.
  • Loading branch information
ladypine committed Nov 21, 2012
1 parent d978548 commit 3f0d4ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions slabs.c
Expand Up @@ -712,6 +712,7 @@ static void slab_rebalance_finish(void) {
print_statm("before shrink");
if (mem_base==NULL){
free(slab_rebal.slab_start);
malloc_trim(settings.item_size_max);
mem_malloced -= settings.item_size_max;
print_statm("after shrink");
}
Expand Down

0 comments on commit 3f0d4ef

Please sign in to comment.