Closed
Description
Using numpy-1.11.1 with the patch for issue #7813 on 64-bit Python, creating an array of size=0 several times raises MemoryError
on a Windows 10 system with 32 GB RAM:
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> a = numpy.zeros((0, 2**31-1))
>>> a.size
0
>>> a = numpy.zeros((0, 2**31-1))
>>> a = numpy.zeros((0, 2**31-1))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError
According to the the VMMap tool, every call to numpy.zeros((0, 2**31-1))
allocates ~16GB on the heap.
I would not expect the creation of an array of size=0 to fail with MemoryError
(64-bit) or ValueError
(32-bit).