[Numpy-tickets] [NumPy] #394: Memory leak in .argsort() method

NumPy numpy-tickets@scipy....
Thu Mar 1 17:28:28 CST 2007

#394: Memory leak in .argsort() method
 Reporter:  faltet  |        Owner:  somebody
     Type:  defect  |       Status:  new     
 Priority:  normal  |    Milestone:          
Component:  Other   |      Version:  devel   
 Severity:  normal  |   Resolution:          
 Keywords:          |  
Comment (by oliverbock):

 I'm getting a memory leak in setdiff1d.  I've added my report to this bug
 because I suspect the leak in argsort is the root cause---setdiff1d's
 implementation uses setmember1d, which uses argsort.

 The program below demonstrates the leak.  You can observe the program
 increasing its memory usage very rapidly, when it shouldn't increase at

 import numpy
 s1 = numpy.arange(3000)
 s2 = numpy.arange(3000)
 while True:
     s = numpy.setdiff1d(s1, s2)


 When this bug is closed, could you please verify that setdiff1d is now
 also leak free?

Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/394#comment:2>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list