STINNER Victor added the comment:
Without the patch, 1 << (2**29) allocates 69.9 MB. With the patch, 1 << (2**29)
allocates 0.1 MB (104 KB).
Without the patch,
$ ./python
Python 3.5.0a0 (default:5b0fda8f5718, May 2 2014, 22:47:06)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux
>>> import os
>>> os.system("grep RSS /proc/%s/status" % os.getpid())
VmRSS: 6164 kB
>>> x=1 << (2**29)
>>> os.system("grep RSS /proc/%s/status" % os.getpid())
VmRSS: 76064 kB
With the patch:
haypo@selma$ ./python
Python 3.5.0a0 (default:5b0fda8f5718+, May 2 2014, 22:55:47)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("grep RSS /proc/%s/status" % os.getpid())
VmRSS: 5864 kB
>>> x=1 << (2**29)
>>> os.system("grep RSS /proc/%s/status" % os.getpid())
VmRSS: 5968 kB
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21419>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com