[Numpy-tickets] [NumPy] #602: Memory leak in ufunc_update_use_defaults

NumPy numpy-tickets@scipy....
Sun Oct 28 16:36:48 CDT 2007


#602: Memory leak in ufunc_update_use_defaults
------------------------+---------------------------------------------------
 Reporter:  langner     |       Owner:  somebody                            
     Type:  defect      |      Status:  new                                 
 Priority:  normal      |   Milestone:  1.0.4                               
Component:  numpy.core  |     Version:  devel                               
 Severity:  normal      |    Keywords:  memory leak, array formatting, float
------------------------+---------------------------------------------------
 A missing Py_DECREF(errobj) in ufunc_update_use_defaults (ufuncobject.c)
 causes references to cumulate and memory to leak. The function is called
 by ufunc_seterr, which is called for instance when formatting float arrays
 (from the method FloatFormat.fillFormat). Resident process memory grows
 rapidly due to this, for instance in the loop:


 {{{
 while True:
     s = numpy.array([1.0]).__str__()
 }}}

 Patch for r4210 of trunk/numpy/core/src/ufuncobject.c:
 3206a3207
 >     Py_DECREF(errobj);

 This has been discussed on the list:
 http://projects.scipy.org/pipermail/numpy-
 discussion/2007-October/029667.html http://projects.scipy.org/pipermail
 /numpy-discussion/2007-October/029669.html

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/602>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list