<div dir="ltr">Thanks David!<br><br>Is it possible to copy the actual imageData from the reader and then delete the reader.<br><br>As far as this is considered <br><br>vtkImageData* img = rd->GetOutput();<br><br>rd will stay in memory untill img goes out of scope. <br>
<br>is that correct?<br><br><div class="gmail_quote">On Tue, May 15, 2012 at 3:21 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, May 15, 2012 at 10:19 AM, Jothybasu Selvaraj<br>
<<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I have a pipeline like this, every time I call this function the memory<br>
> increases ~10MB. How can I fix this?<br>
<br>
</div>When you do this:<br>
<div class="im"><br>
vtkSmartPointer<vtkImageData>img=<br>
vtkSmartPointer<vtkImageData>::New();<br>
</div>img=rd->GetOutput();<br>
<br>
You are chaging where 'img' is pointing. I don't think even smart<br>
pointers are smart enough to notice that. You need to instead do:<br>
<br>
vtkImageData* img = rd->GetOutput();<br>
<br>
(notice New() was never called for 'img') so that you aren't<br>
allocating memory for the image and then stranding it.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>