Reduce memory fragmentation with MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ Reduce memory fragmentation with MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ python python

Reduce memory fragmentation with MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_


Being in production with this tweak for a long time now, without issues.So, I think it's a viable option to improve memory usage in long-running Python processes, in certain cases.


I'm also using:

MALLOC_MMAP_THRESHOLD_=8192MALLOC_ARENA_MAX=4

So far, great results!