Re:Run Python Applications Efficiently with malloc_trim
by jnwatson on Monday November 16, 2020 @03:53PM
(#25116870)
Keep in mind that’s from Python 2.5. Modern Python uses arenas that always use mmap.
Re:Run Python Applications Efficiently with malloc_trim
by lbolla on Monday November 16, 2020 @05:41PM
(#25118012)
I developed that tweak for Python 2.7 and I am running in production with Python 3.6. I tested with later Python versions, too.
Do you have some pointers about arenas always using mmap? I'd like to know how that trick can work if that was the case.
Re:Run Python Applications Efficiently with malloc_trim
by cmeacham98 on Tuesday November 17, 2020 @12:38AM
(#25120606)
It doesn't work, that's their point. With modern python versions those env variables do next to nothing. It won't crash your python but it also won't help you.
The idea is to tweak when `mmap` or `malloc` are used by the Python interpreter. One allows memory to be released to the OS right away, whereas the other is not.
It is a useful trick if your application is generating lots of small objects.