Loosely related topic: In our very unusual setup (...
# openvox
d
Loosely related topic: In our very unusual setup (40+ instances in containers on a single Mashine) we have serious memory pressure, and memory is expensive. Java and JRuby are heavy, even with limited heap sizes and tuned GC parameters. A good chunk of the wasted RSS memory is not in the java heap though. I just learned about
MALLOC_ARENA_MAX
and plan to use that in all containers we run. Let's see if this helps. If yes, I'd suggest adding that per default to containers images. To sum it up: The default glibc memory manager pre-allocates multiple chunks from the kernel to be able to serve allocations coming from multiple application threads at the same time without locking. The default maximum is 8 time the CPU count, and each chunk can be up to 64MB of (mostly wasted) memory. This quickly adds up, especially in long running multi threaded applications on beefy hardware. Which is exactly our use-case. Reducing the maximum arena count to 2 may save a ton of memory that can be better used by other containers. The drawback should be minimal, because most of the allocation pressure in java is internal (java has its own heap) anyway, so it is very unlikely that more than two threads call
malloc
at the same time, and even if, the wait time is just nanoseconds.