Hi Sebastien,<div><br></div><div>Yes, I don&#39;t delete it on purpose.<div><br></div><div>I would like to keep the polydata in memory but delete everything else which is related to the visualization in order to decrease the memory usage!</div>
<div><br></div><div>Thanks</div><div><br></div><div>Nicolas</div><div><br><div class="gmail_quote">On Sat, Jul 2, 2011 at 11:19 PM, Sebastien Jourdain <span dir="ltr">&lt;<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">You never deleted the sphere.<br>
<div><div></div><div class="h5"><br>
On Tue, Jun 28, 2011 at 5:56 PM, Nicolas Rannou &lt;<a href="mailto:nicolas.lists@gmail.com">nicolas.lists@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt; I would like to delete/remove actors from my rendering window to free<br>
&gt; memory.<br>
&gt; The issue is that the memory usage doesn&#39;t decrease after removing/deleting<br>
&gt; the actors.<br>
&gt; From my understanding, both following pseudo-codes should use the same<br>
&gt; amount of memory.<br>
&gt; But,<br>
&gt; The first one uses: 15 Mb for 1000 spheres:<br>
&gt; The second uses: 90 Mb for 1000 spheres:<br>
&gt; How should I proceed in the 2nd case, to get back to the &quot;original&quot; memory<br>
&gt; usage without actor?<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Nicolas<br>
&gt; ______________________________<br>
&gt; 15 Mb<br>
&gt; ______________________________<br>
&gt; //Create a sphere<br>
&gt; vtkSphereSource* sphere = new ...<br>
&gt; ______________________________<br>
&gt; 90 Mb<br>
&gt; ______________________________<br>
&gt; //Create sphere<br>
&gt; vtkSphereSource* sphere = new ...<br>
&gt; // mapper<br>
&gt; vtkMapper* mapper ...<br>
&gt; mapper-&gt;SetInput( sphere-&gt;GetOutput() )<br>
&gt; // actor<br>
&gt; vtkActor* actor...<br>
&gt; actor-&gt;SetMapper(mapper)<br>
&gt; mapper-&gt;Delete()<br>
&gt; // Add and remove actor<br>
&gt; renderer-&gt;AddActor(actor)<br>
&gt; renderer-&gt;RemoveActor(actor)<br>
&gt; // Delete actor<br>
&gt; actor-&gt;Delete()<br>
&gt; ______________________________<br>
&gt; ______________________________<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br></div></div>