[issue11849] glibc allocator doesn't release all free()ed memory

Antoine Pitrou report at bugs.python.org
Fri Nov 25 13:52:56 CET 2011

Antoine Pitrou <pitrou at free.fr> added the comment:

Ah, sorry, false alarm. "b[:] = b" actually makes a temporary copy of the bytearray when assigning to itself (!).

However, there's still another strange regression:

$ ./python -m timeit \
  -s "n=300000; f=open('10MB.bin', 'rb', buffering=0); b=bytearray(n)" \

-> default branch:
10000 loops, best of 3: 43 usec per loop
-> default branch with patch reverted:
10000 loops, best of 3: 27.5 usec per loop

FileIO.readinto executes a single read() into the passed buffer.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list