1. 19
  1.  

  2. 4

    Glibc’s default arena allocation strategy has proven to be a disaster in the Ruby world too. It leads to massive RSS bloat for processes with many threads. Everyone is advised to set MALLOC_ARENA_MAX=2.

    1. 3

      Preallocation behavior can be adjusted with the environment variable MALLOC_ARENA_MAX=4

      […]

      A value of 1 can disable it, but is likely to reduce performance by a few percents, so not recommended.

      Will it? I was under the assumption that JVM allocators relied directly on mmap/VirtualAlloc (or similar) and didn’t really touch the system malloc. Is that untrue?

      1. 1

        The glibc allocator is still present and initialized.

        1. 1

          Right. The question is, why does this affect performance if the allocator is never used?

          1. 1

            There’s no mention of a performance degradation here and indeed, there shouldn’t be any. What there is instead is a massive additional memory usage which serves no purpose in practice.

            1. 1

              I quoted a mention of performance degradation.

              A value of 1 can disable it, but is likely to reduce performance by a few percents, so not recommended.