Memory management

Hi All
Is there anybody who can explain me where the memory expends in this example. I think that after function ending the memory must free. But about 150 MB keep inaccessible.

tanks.

void CTopologyTriangulationDoc::OnVisu()
{
TopoDS_Shape theTor = BRepPrimAPI_MakeTorus(200,60);
TopoDS_Shape theSphere = BRepPrimAPI_MakeSphere(gp_Pnt(100,20,20),80);
TopoDS_Shape ShapeFused = BRepAlgoAPI_Fuse(theSphere,theTor);

BRepMesh::Mesh(ShapeFused,0.1);

BRep_Builder builder;
TopoDS_Compound Comp;
builder.MakeCompound(Comp);

for(TopExp_Explorer ex(ShapeFused,TopAbs_FACE);ex.More();ex.Next()) {
TopoDS_Face F =TopoDS::Face(ex.Current());
TopLoc_Location L;

Handle (Poly_Triangulation) facing = BRep_Tool::Triangulation(F,L);
TColgp_Array1OfPnt tab (1,(facing->NbNodes()));
tab = facing->Nodes();

Poly_Array1OfTriangle tri (1,facing->NbTriangles());
tri=facing->Triangles();

for (Standard_Integer i=1;iNbTriangles());i++)
{
Poly_Triangle trian = tri.Value(i);
Standard_Integer index1,index2,index3,M,N;
trian.Get(index1,index2,index3);

for (Standard_Integer j=1;j {
switch (j)
{
case 1 :
M = index1;
N = index2;
break;
case 2 :
N = index3;
break;
case 3 :
M = index2;
}

BRepBuilderAPI_MakeEdge ME(tab.Value(M),tab.Value(N));

if (ME.IsDone())
{
builder.Add(Comp,ME.Edge());

}
}
}
}
}

Rob Bachrach's picture

Check out the thread:
http://www.opencascade.org/org/forum/thread_7199/

There is a known problem with memory leaks in the 5.2 boolean operations. The OCC team claims it will be fixed in the next public release.

Marina's picture

this problem is not only in boolean operation. Such problem appears for any initial shape