Permalink
Browse files

malloc_trim with the slab size after shrinkage actually frees the mem…

…ory to the system, even in cases of large caches and small releases.
  • Loading branch information...
1 parent d978548 commit 3f0d4efd42cbd72f0caaee17261278980148438d @ladypine committed Nov 21, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 slabs.c
View
@@ -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");
}

0 comments on commit 3f0d4ef

Please sign in to comment.