-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
numpy.zeros((0, 2**31-1)) raises MemoryError #7819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See also #7813 (comment) |
Oh, is this a new bug or an old? Oh well, probably does not matter. I think it is supposed to allocate a single element for these arrays, though even that should really be unnecessary. |
@seberg Old. There is a comment in the code that some memory is needed:
But that path is never taken currently. I'll put up a patch. |
See #7820. |
hm there is nothing worth releasing on the branch, why the rush? |
There is also a fix for a failing test in pending scipy release. |
@juliantaylor See #7515. However, the release schedule is negotiable. |
#7813 causes scipy.test() to crash on 32 bit Python 2.6-3.4 for Windows. That's how I discovered the issues. |
Thanks for the fix and backport @charris. Still, I would not expect |
Well, it is a bit of a theoretical construct and there are some things (like stride/size after view) which may misbehave. So I think it is correct to just disallow it. I admit the error message might be a bit confusing in this specific case. |
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: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) orValueError
(32-bit).The text was updated successfully, but these errors were encountered: