<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I have a big problem of memory managment using VTK 
libraries.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In my window's document constructor I instantiate a 
set of VTK objects as follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><BR>&nbsp; this-&gt;Reader = 
vtkDataSetReader::New();<BR>&nbsp; this-&gt;Mapper = 
vtkPolyDataMapper::New();<BR>&nbsp; this-&gt;Actor = vtkActor::New();<BR>&nbsp; 
this-&gt;CutterMapper = vtkPolyDataMapper::New();<BR>&nbsp; this-&gt;CutterActor 
= vtkActor::New();<BR>&nbsp; this-&gt;ContourMapper = 
vtkPolyDataMapper::New();<BR>&nbsp; this-&gt;ContourActor = 
vtkActor::New();&nbsp;<BR>&nbsp; this-&gt;Smoother = 
vtkSmoothPolyDataFilter::New();<BR>&nbsp; this-&gt;Decimator = 
vtkDecimatePro::New();<BR>&nbsp; 
this-&gt;Actor-&gt;SetMapper(this-&gt;Mapper);<BR>&nbsp; 
this-&gt;Actor-&gt;VisibilityOff();<BR>&nbsp; 
this-&gt;CutterActor-&gt;SetMapper(this-&gt;CutterMapper);<BR>&nbsp; 
this-&gt;CutterActor-&gt;VisibilityOff();<BR>&nbsp; 
this-&gt;ContourActor-&gt;SetMapper(this-&gt;ContourMapper);<BR>&nbsp; 
this-&gt;ContourActor-&gt;VisibilityOff();<BR>&nbsp; 
this-&gt;Props-&gt;AddItem(this-&gt;Actor);<BR>&nbsp; 
this-&gt;Props-&gt;AddItem(this-&gt;CutterActor);<BR>&nbsp; 
this-&gt;Props-&gt;AddItem(this-&gt;ContourActor);<BR>&nbsp; 
this-&gt;Points&nbsp;&nbsp;=&nbsp;vtkPoints::New();<BR>&nbsp; 
this-&gt;PolyData&nbsp;=&nbsp;vtkPolyData::New();<BR>&nbsp; 
this-&gt;Delaunay2D&nbsp;=&nbsp;&nbsp; vtkDelaunay2D::New();<BR>&nbsp; 
this-&gt;TriangleFilter = vtkTriangleFilter::New();<BR>&nbsp; this-&gt;Cutter = 
vtkCutter::New();<BR>&nbsp; this-&gt;CutterPlane = vtkPlane::New();<BR>&nbsp; 
this-&gt;ContourPlane = vtkPlane::New();<BR>&nbsp; this-&gt;Contour = 
vtkCutter::New();<BR>&nbsp; </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; and in the destructor I use the following 
instructions:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; 
this-&gt;TriangleFilter-&gt;Delete();<BR>&nbsp; 
this-&gt;Delaunay2D-&gt;Delete();<BR>&nbsp; 
this-&gt;PolyData-&gt;Delete();<BR>&nbsp; 
this-&gt;Points-&gt;Delete();<BR>&nbsp; this-&gt;Reader-&gt;Delete();<BR>&nbsp; 
this-&gt;Mapper-&gt;Delete();<BR>&nbsp; this-&gt;Actor-&gt;Delete();<BR>&nbsp; 
this-&gt;CutterMapper-&gt;Delete();<BR>&nbsp; 
this-&gt;CutterActor-&gt;Delete();<BR>&nbsp; 
this-&gt;ContourMapper-&gt;Delete();<BR>&nbsp; 
this-&gt;ContourActor-&gt;Delete();<BR>&nbsp; 
this-&gt;Smoother-&gt;Delete();<BR>&nbsp; 
this-&gt;Decimator-&gt;Delete();<BR>&nbsp; 
this-&gt;ContourPlane-&gt;Delete();<BR>&nbsp; 
this-&gt;Contour-&gt;Delete();<BR>&nbsp; this-&gt;Cutter-&gt;Delete();<BR>&nbsp; 
this-&gt;CutterPlane-&gt;Delete();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><BR>After the class' destruction I can see that VTK 
libraries don't free all the memory<BR>they allocated. Otherwise, after showing 
a model of about 150.000 triangles, I lose<BR>about 50-80Mb of RAM.<BR>So, I 
have only to show 2 or 3 models to reach the phisical memory limit.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Where do I do the mistake?<BR>Thank you in advance 
for any help!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Michele Zamponi</FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="mailto:michele.zamponi@menci.com">michele.zamponi@menci.com</A><BR></DIV></FONT></BODY></HTML>