<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-&gt;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">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</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>
&lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I have a pipeline like this, every time I call this function the memory<br>
&gt; increases ~10MB. How can I fix this?<br>
<br>
</div>When you do this:<br>
<div class="im"><br>
vtkSmartPointer&lt;vtkImageData&gt;img=<br>
     vtkSmartPointer&lt;vtkImageData&gt;::New();<br>
</div>img=rd-&gt;GetOutput();<br>
<br>
You are chaging where &#39;img&#39; is pointing. I don&#39;t think even smart<br>
pointers are smart enough to notice that. You need to instead do:<br>
<br>
vtkImageData* img = rd-&gt;GetOutput();<br>
<br>
(notice New() was never called for &#39;img&#39;) so that you aren&#39;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>