folly::getJEMallocMallctlArenasAll

Return value of MALLCTL_ARENAS_ALL defined in jemalloc's header.

Synopsis

Declared in <folly/memory/Malloc.h>

size_t
getJEMallocMallctlArenasAll();

Description

Technically doesn't require that the system is using jemalloc, but jemalloc header must be included, if it is not, then call to this function will throw std::logic_error exception.

Usage example:

if (folly::usingJEMalloc()) { static const std::string kCmd = fmt::format("arena.{}.purge", folly::getJEMallocMallctlArenasAll()); folly::mallctlCall(kCmd.c_str()); }

Return Value

size_t