<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</STYLE>

<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><SPAN class=252122517-21042008><FONT face="Courier New" 
color=#0000ff>Cameron,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=252122517-21042008><FONT face="Courier New" 
color=#0000ff>I experienced the same problem in the past and ended up with smart 
pointers:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=252122517-21042008>
<P><FONT face="Courier New" color=#0000ff><SPAN 
class=252122517-21042008>{</SPAN></FONT></P>
<P><FONT><FONT face="Courier New"><FONT color=#0000ff><SPAN 
class=252122517-21042008>&nbsp;&nbsp;&nbsp; </SPAN>vtkSmartPointer&lt;<SPAN 
class=252122517-21042008>...</SPAN>&gt;&nbsp;<SPAN 
class=252122517-21042008>myObj</SPAN> = vtkSmartPointer&lt;<SPAN 
class=252122517-21042008>...</SPAN>&gt;::New();</FONT></FONT></FONT></P>
<P><SPAN class=252122517-21042008><FONT face="Courier New" 
color=#0000ff>}</FONT></SPAN></P>
<P><SPAN class=252122517-21042008><FONT face="Courier New" color=#0000ff>My 
guess some vtk items&nbsp;creates silently&nbsp;child objects down the hierarchy 
tree.</FONT></SPAN></P>
<P><SPAN class=252122517-21042008><FONT face="Courier New" 
color=#0000ff></FONT></SPAN>&nbsp;</P>
<P><SPAN class=252122517-21042008><FONT face="Courier New" color=#0000ff>Happy 
programming!</FONT></SPAN></P>
<P><SPAN class=252122517-21042008><FONT face="Courier New" 
color=#0000ff>Gennady</FONT></SPAN></P></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> Cameron Burnett 
[mailto:w_e_b_m_a_s_t_e_r_6_9@hotmail.com] <BR><B>Sent:</B> Monday, April 21, 
2008 5:48 AM<BR><B>To:</B> vtkusers@vtk.org<BR><B>Subject:</B> [vtkusers] 
Problem freeing memory<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV style="TEXT-ALIGN: left">Hi,<BR><BR>I'm currently trying to free the memory 
taken up by my DICOM loading function (vtkDICOMImageReader). The problem is that 
I call Delete on everything that I've instantiated, but the ~700MB still remains 
in the RAM.<BR><BR>The vtkVolume that I read the object into is global, so I've 
got a button that removes it from the renderer and then deletes it, like 
so...<BR><BR>&nbsp;&nbsp; 
this-&gt;pvtkRenderer-&gt;RemoveActor(this-&gt;volume);<BR>&nbsp; 
this-&gt;pvtkRenderer-&gt;RemoveAllViewProps();&nbsp;&nbsp; &nbsp;&nbsp; 
&nbsp;&nbsp; &nbsp;&nbsp; //for good measure :)<BR>&nbsp; 
this-&gt;volume-&gt;Delete();<BR><BR><BR>What else would I have to do? I've 
called Delete on everything in the load function, and I've deleted the volume 
object itself..... so.... I don't know.<BR><BR>I realise that the Delete funtion 
only decreases the counter for that object, but all i'm doing is loading in a 
DICOM object and deleting it.... so nothing else should be using 
it.<BR><BR>Maybe there is a Cleanup function or 
something??<BR><BR><BR><BR>Thanks,<BR>Cameron.<BR></DIV><BR>
<DIV></DIV><BR><BR>
<HR>
Grab it. <A href="http://mycareer.com.au/?s_cid=596065 " target=_new>You dream 
job is up for grabs.</A> </BODY></HTML>