[Insight-users] itk.PyBuffer memory leak

Rick Giuly rgiuly at gmail.com
Sun May 10 23:43:22 EDT 2009


Hello All,

It seems that converter.GetImageFromArray(inputNumpyVolume) allocates 
memory in some way and never releases it. When I tried using Delete() 
the program actually crashed silently after one iteration.

Test code is below. (I'm running this on ubuntu, and the itk package is 
from Paul Novo's site.)

Is there some way to release memory?



import itk
import numpy

for i in range(10000):

     print i

     ImageType = itk.Image[itk.F, 3]
     converter = itk.PyBuffer[ImageType]

     inputNumpyVolume = numpy.ones((100, 100, 200))
     inputVolume = converter.GetImageFromArray(inputNumpyVolume)
     #inputVolume.Delete()



----------
Thanks,
  --Rick


More information about the Insight-users mailing list