[issue21116] Failure to create multiprocessing shared arrays larger than 50% of memory size under linux

Richard Oudkerk report at bugs.python.org
Thu Apr 3 01:20:53 CEST 2014


Richard Oudkerk added the comment:

Using truncate() to zero extend is not really portable: it is only guaranteed on XSI-compliant POSIX systems.

Also, the FreeBSD man page for mmap() has the following warning:

WARNING! Extending a file with ftruncate(2), thus creating a big
hole, and then filling the hole by modifying a shared mmap() can
lead to severe file fragmentation.  In order to avoid such
fragmentation you should always pre-allocate the file's backing
store by write()ing zero's into the newly extended area prior to
modifying the area via your mmap().  The fragmentation problem is
especially sensitive to MAP_NOSYNC pages, because pages may be
flushed to disk in a totally random order.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21116>
_______________________________________


More information about the Python-bugs-list mailing list