Antti Haapala added the comment:

mmap is not the problem, the eagerness of munmap is a source of possible 
problem. 

The munmap eagerness does not show problems in all programs because the arena 
allocation heuristics do not work as intended. A proper solution in Linux and 
other operating systems where it is supported, is to put the freed arenas in a 
list, then mark freed with MADV_FREE. Now if the memory pressure grows, only 
*then* will the OS reclaim these. At any time the application can start reusing 
these arenas/pages; if they're not reclaimed, the old contents will be still 
present there; if operating system reclaimed them, they'd be remapped with 
zeroes.

Really the only downside of all this that I can foresee is that 
`ps/top/whatever` output would see Python using way more memory in its 
RSS/virt/whatever than it is actually using.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26601>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to