Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upmemory leak with typed ndarray and memory views #2828
Comments
jhauschild
changed the title
memory leak with typed ndarray
memory leak with typed ndarray and memory views
Feb 12, 2019
scoder
added
defect
Buffers
labels
Feb 15, 2019
This comment has been minimized.
This comment has been minimized.
I looked into this a bit and could reproduce it. Not sure where the problem is, though. It would help to see if moving either NumPy or Cython out of the way would show the same issue, so that we can see if it's due to Cython or NumPy (or a mix of both). Also, arrays with a zero dimension, while certainly not useless, do not seem like a particularly critical use case to fix. That might also be the reason why it's not been found and/or reported so far. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jhauschild commentedFeb 8, 2019
•
edited
Hi,
I found a memory leak when using the
np.ndarray[np.intp_t, ndim=2]
syntax or memory views of dimension at least 2.Strangely, the memory leak only appears if the second dimension is 0, irregardless of the other dimensions. I checked that it also appears with ndim=3 (also if the second dimension is zero).
Minimal example:
# a.pyx
# compile: cythonize -bi a.pyx
# run: python -c 'import a; a.main()'
Sample output:
Any ideas what might cause this strange behaviour?