Recipients davin, dtasev,, sbt, serhiy.storchaka
Date 2017-07-13.15:59:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In Python 2.7, multiprocessing.heap.Arena uses an anonymous memory mapping on Unix. Anonymous memory mappings can be shared between processes but only via fork().

But Python 3 supports other ways of starting subprocesses (see issue 8713 [1]) and so an anonymous memory mapping no longer works. So instead a temporary file is created, filled with zeros to the given size, and mapped into memory (see changeset 3b82e0d83bf9 [2]). It is the zero-filling of the temporary file that takes the time, because this forces the operating system to allocate space on the disk.

But why not use ftruncate() (instead of write()) to quickly create a file with holes? POSIX says [3], "If the file size is increased, the extended area shall appear as if it were zero-filled" which would seem to satisfy the requirement.

Date User Action Args
2017-07-13 15:59:56gdr@garethrees.orgsetrecipients: +, sbt, serhiy.storchaka, davin, dtasev
2017-07-13 15:59:56gdr@garethrees.orgsetmessageid: <>
2017-07-13 15:59:56gdr@garethrees.orglinkissue30919 messages
2017-07-13 15:59:55gdr@garethrees.orgcreate