[Scipy-tickets] [SciPy] #382: [PATCH] memory leak in delaunay

SciPy scipy-tickets@scipy....
Thu Mar 1 11:56:54 CST 2007

#382: [PATCH] memory leak in delaunay
 Reporter:  pv      |       Owner:  somebody            
     Type:  defect  |      Status:  new                 
 Priority:  normal  |   Milestone:                      
Component:  Other   |     Version:  devel               
 Severity:  normal  |    Keywords:  delaunay memory leak
 import scipy as S
 from delaunay import Triangulation

 x, y = S.meshgrid([0, 1, 2], [0, 1, 2])
 z = S.zeros(x.shape) + 1

 tri = Triangulation(x.flatten(), y.flatten())
 interp = tri.nn_interpolator(z.flatten())

 for x in range(10000):
     xx = S.zeros((1000000), dtype=S.float64)
     interp(xx, xx)

 The call to ''interp'' appears to leak memory. However, no memory is
 leaked if the ''xx'' variable passed to ''interp'' is created outside the

 The attached patch appears to fix this: apparently cleanup was forgotten
 when the function is successful.

Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/382>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list