[ITK] [ITK-users] PyBuffer memory consumption

Harnish, Roy Roy.Harnish at ucsf.edu
Thu Sep 1 17:39:42 EDT 2016


Hi,

I'm resurrecting a thread that I ran across trying to debug what looks to be a memory leak when using PyBuffer:

https://itk.org/pipermail/insight-users/2009-May/030386.html

If I repeatedly assign the output of itk.PyBuffer[ImageType].GetImageFromArray() to the same python variable name, more and more memory is consumed by the process. Wondering if anyone knows how to get this memory released? Here's some example code based on the linked thread that should reproduce the problem:

import itk
import numpy as np
import resource

M = []

for i in range(200):

  M.append(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss)

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

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

print M

Any suggestions much appreciated.

Roy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160901/74ad9604/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list