MCPcopy Create free account
hub / github.com/F-Stack/f-stack / jemalloc_purge

Function jemalloc_purge

app/redis-6.2.6/src/zmalloc.c:506–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506int jemalloc_purge() {
507 /* return all unused (reserved) pages to the OS */
508 char tmp[32];
509 unsigned narenas = 0;
510 size_t sz = sizeof(unsigned);
511 if (!je_mallctl("arenas.narenas", &narenas, &sz, NULL, 0)) {
512 sprintf(tmp, "arena.%d.purge", narenas);
513 if (!je_mallctl(tmp, NULL, 0, NULL, 0))
514 return 0;
515 }
516 return -1;
517}
518
519#else
520

Callers 3

memoryCommandFunction · 0.85
flushAllDataAndResetRDBFunction · 0.85
flushdbCommandFunction · 0.85

Calls 2

je_mallctlFunction · 0.85
sprintfFunction · 0.85

Tested by

no test coverage detected