<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,
<br>
<br>
I'm resurrecting a thread that I ran across trying to debug what looks to be a memory leak when using PyBuffer:<br>
<br>
<a href="https://itk.org/pipermail/insight-users/2009-May/030386.html" target="_blank">https://itk.org/pipermail/insight-users/2009-May/030386.html</a><br>
<br>
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:<br>
<br>
<b>import itk<br>
import numpy as np<br>
import resource<br>
<br>
M = []<br>
<br>
for i in range(200):<br>
<br>
  M.append(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss)<br>
<br>
  ImageType = itk.Image[itk.D, 3]<br>
  converter = itk.PyBuffer[ImageType]<br>
<br>
  inputNumpyVolume = np.ones((100, 100, 100))<br>
  inputVolume = converter.GetImageFromArray(inputNumpyVolume)<br>
#  inputVolume.Delete()<br>
  <br>
print M</b><br>
<br>
Any suggestions much appreciated.<br>
<br>
Roy<br>
</div>
</body>
</html>