Skip to content

Commit

Permalink
Purge memory when initializing new kb
Browse files Browse the repository at this point in the history
This way unused memory is made available to the
OS again.
  • Loading branch information
ArnoStiefvater authored and jjnicola committed Mar 15, 2021
1 parent 0825fd9 commit aa4f735
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/kb.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ redis_new (kb_t *kb, const char *kb_path)
}

*kb = (kb_t) kbr;

/* Try to make unused memory available for the OS again. */
if (redis_memory_purge (*kb))
g_warning ("%s: Memory purge was not successfull", __func__);

return rc;
}

Expand Down

0 comments on commit aa4f735

Please sign in to comment.