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

Stuart Wilkins swilkins@bnl....
Wed Nov 3 19:30:09 CDT 2010


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?

More information about the SciPy-User mailing list