#19621·logstash

Consider setting `MALLOC_ARENA_MAX` explicitly

Author: robbaveyCreated Sep 30, 2026Updated Sep 30, 2026

We have observed issues with long running Logstash processes showing increased native memory usage over time, despite observing no memory leaks either through NMT, or using jemalloc profiling.

When using jemalloc, we also observed that the increased native memory usage was no longer present, which led us to a few different paths:

  • Switch to using jemalloc instead of glibc memory allocator
  • Investigate setting MALLOC_ARENA_MAX to a lower value to reduce memory fragmentation (https://github.com/prestodb/presto/issues/8993 provides an excellent explainer of why this is important)

After running tests, and observing native memory behavior, we have found that MALLOC_ARENA_MAX to a lower value has been successful in removing these leaks, but we should further investigate an appropriate value to set this by default.