[SciPy-User] Memory Leak? Problems with deleting numpy arrays.

Stuart Wilkins swilkins at bnl.gov
Wed Nov 3 20:30:09 EDT 2010


Hi,

I am having some difficulty with memory management with numpy arrays. I have some c-code which creates a numpy array which is fairly large (2 Gb), this is passed back to python. Checking the reference count, it is 2 at this point. After performing a further operation, the reference count is still 2 and then I delete it. 

The problem is that the memory never gets released. It does not take too many passes for this  to basically fail as the system runs out of memory.

So? Does anyone have any ideas? I can send code later. What should the ref count be before del to ensure that the object is garbage collected? 

I find calling gc.collect() does not solve the problem.

Any ideas?
S


More information about the SciPy-User mailing list