STINNER Victor <victor.stin...@haypocalc.com> added the comment:

Python 3.2 has a _posixsubprocess: some parts of subprocess are implemented in 
C. Can you try it?

Python 3.2 uses also pipe2(), if available, to avoid the extra fcntl(4, 
F_GETFD)+fcntl(4, F_SETFD, FD_CLOEXEC).

I suppose that the pipe and mmap(NULL, 1052672, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) is used by subprocess to transfer a Python 
exception from the child process. Python 2.7 encodes the exception value, type 
and traceback using pickle, and the parent process calls os.read(1048576). 
Python 3.2 only encodes the exception value and type using a simple string, the 
parent process uses bytearray with chunks of 50,000 bytes (stop when the total 
size is bigger than 50,000 bytes). So I suppose that Python 3.2 allocates less 
memory in the parent process to read the child exception (if any).

You may also try to change Popen buffer size, but it should not change anything 
if you test "exit 0".

----------
nosy: +haypo

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

Reply via email to