<!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> </DIV>
<DIV><FONT face=Arial size=2>I have a big problem of memory managment using VTK
libraries.</FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT face=Arial size=2><BR> this->Reader =
vtkDataSetReader::New();<BR> this->Mapper =
vtkPolyDataMapper::New();<BR> this->Actor = vtkActor::New();<BR>
this->CutterMapper = vtkPolyDataMapper::New();<BR> this->CutterActor
= vtkActor::New();<BR> this->ContourMapper =
vtkPolyDataMapper::New();<BR> this->ContourActor =
vtkActor::New(); <BR> this->Smoother =
vtkSmoothPolyDataFilter::New();<BR> this->Decimator =
vtkDecimatePro::New();<BR>
this->Actor->SetMapper(this->Mapper);<BR>
this->Actor->VisibilityOff();<BR>
this->CutterActor->SetMapper(this->CutterMapper);<BR>
this->CutterActor->VisibilityOff();<BR>
this->ContourActor->SetMapper(this->ContourMapper);<BR>
this->ContourActor->VisibilityOff();<BR>
this->Props->AddItem(this->Actor);<BR>
this->Props->AddItem(this->CutterActor);<BR>
this->Props->AddItem(this->ContourActor);<BR>
this->Points = vtkPoints::New();<BR>
this->PolyData = vtkPolyData::New();<BR>
this->Delaunay2D = vtkDelaunay2D::New();<BR>
this->TriangleFilter = vtkTriangleFilter::New();<BR> this->Cutter =
vtkCutter::New();<BR> this->CutterPlane = vtkPlane::New();<BR>
this->ContourPlane = vtkPlane::New();<BR> this->Contour =
vtkCutter::New();<BR> </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> and in the destructor I use the following
instructions:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
this->TriangleFilter->Delete();<BR>
this->Delaunay2D->Delete();<BR>
this->PolyData->Delete();<BR>
this->Points->Delete();<BR> this->Reader->Delete();<BR>
this->Mapper->Delete();<BR> this->Actor->Delete();<BR>
this->CutterMapper->Delete();<BR>
this->CutterActor->Delete();<BR>
this->ContourMapper->Delete();<BR>
this->ContourActor->Delete();<BR>
this->Smoother->Delete();<BR>
this->Decimator->Delete();<BR>
this->ContourPlane->Delete();<BR>
this->Contour->Delete();<BR> this->Cutter->Delete();<BR>
this->CutterPlane->Delete();</FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT face=Arial size=2>Where do I do the mistake?<BR>Thank you in advance
for any help!</FONT></DIV>
<DIV> </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>