<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Does the memory location pointed by variable actor still contain a valid 
object (e.g. reference count &gt; 0) after actor-&gt;Delete()?&nbsp; If not, 
then memory used by actor should have been released.</DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV><FONT size=3 face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT size=3 face=Calibri>xz</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=nicolas.lists@gmail.com 
href="mailto:nicolas.lists@gmail.com">Nicolas Rannou</A> </DIV>
<DIV><B>Sent:</B> Tuesday, July 05, 2011 9:10 AM</DIV>
<DIV><B>To:</B> <A title=sebastien.jourdain@kitware.com 
href="mailto:sebastien.jourdain@kitware.com">Sebastien Jourdain</A> </DIV>
<DIV><B>Cc:</B> <A title=vtkusers@public.kitware.com 
href="mailto:vtkusers@public.kitware.com">vtkusers@public.kitware.com</A> </DIV>
<DIV><B>Subject:</B> Re: [vtkusers] Delete actor and release 
memory</DIV></DIV></DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">Hi 
Sebastien, 
<DIV>&nbsp;</DIV>
<DIV>Yes, I don't delete it on purpose. 
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>Nicolas</DIV>
<DIV>
<DIV>&nbsp;</DIV>
<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 
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
class=gmail_quote>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'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 "original" 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>
<DIV>&nbsp;</DIV></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>Powered by 
www.kitware.com<BR><BR>Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html<BR><BR>Please keep messages 
on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR><BR>Follow 
this link to 
subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></DIV></DIV></DIV></BODY></HTML>