Jemalloc 5.3.1 Memory Library Released

After 4 years since the last update, the memory management library jemalloc 5.3.1 has been released. This library provides an alternate implementation of malloc functions that are optimized to reduce fragmentation and work efficiently on multiprocessor systems. The library utilizes isolated memory allocation areas for each CPU core to address locking issues on multi-core systems, allowing for linear scalability with the increase in the number of threads. You can find more information about this release here.

In June 2025, the original author of the project ceased maintenance and archived the jemalloc repository. However, just a month ago, Meta resumed development of the library, as it is a crucial component of their infrastructure. Originally developed for FreeBSD, jemalloc has been the default memory allocator in this operating system since 2005. The library is written in C and distributed under the BSD license. You can access the library code here.

Some notable changes in this release include:

  • The addition of the pvalloc function, which can be helpful when replacing the libc memory allocator.
  • Enabling double free() function call detection mode in debug builds, alongside the ability to configure the stack size for scanning with the debug_double_free_max_scan parameter.
  • Introducing the build option “–enable-pageid” to set tags when mapping memory using prctl with the PR_SET_VMA flag, enabling monitoring of mapping via /proc//maps once enabled.
  • The inclusion of the “prof_bt_max” parameter to set the maximum stack depth for profiling.
  • Adding the assembly option “–enable-force-getenv” to utilize the regular getenv() function instead of secure_getenv() in the code.
  • Introducing the build option “–disable-dss” to disable the use of the sbrk() function.
  • Including the “tcache_ncached_max” parameter to limit the number of elements in the thread cache.
  • Adding the parameter “calloc_madvise_threshold” to configure the use of the kernel mechanism madvise or the memset function for resetting memory allocated through calloc.
/Reports, release notes, official announcements.