To explain: glibc tries to avoid locking during sm...
# openvox
d
To explain: glibc tries to avoid locking during small
malloc
calls in multi-threaded applications by pre-allocating up to eight chunks of memory per CPU per process by default, each up to 64MB in size. On a 8 core system, this can grow to 8x8x64MB or 4096MB of allocated but unused memory per process. This is extra useless for long-running multi-threaded java applications that manage their own heap and allocate large blocks instead of tiny chunks. Java does not benefit from this glibc optimization at all, it's just pure overhead and wasted memory. By setting
MALLOC_ARENA_MAX=2
we tell glibc to never pre-allocate more than two of those blocks. We can probably set this to
1
and not notice any difference in
malloc
latency. Puppet is not latency-critical anyway.