MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / jemalloc_purge

Function jemalloc_purge

src/zmalloc.cpp:518–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518int jemalloc_purge() {
519 /* return all unused (reserved) pages to the OS */
520 char tmp[32];
521 unsigned narenas = 0;
522 size_t sz = sizeof(unsigned);
523 if (!mallctl("arenas.narenas", &narenas, &sz, NULL, 0)) {
524 snprintf(tmp, sizeof(tmp), "arena.%d.purge", narenas);
525 if (!mallctl(tmp, NULL, 0, NULL, 0))
526 return 0;
527 }
528 return -1;
529}
530
531#else
532

Callers 3

flushAllDataAndResetRDBFunction · 0.85
flushdbCommandFunction · 0.85
memoryCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected