Memory leak?

I ran some codes below twice, and closed the document(not application), then I found some memory isn't released. Codes are as follows:

myAISContext->RemoveAll();

gp_Pnt origin;
origin.SetX(rand() % 1000);
origin.SetY(rand() % 1000);
origin.SetZ(rand() % 100);

for (int i = 0; i {
for (int j = 0; j {
Standard_Real x = origin.X() + i * 2;
Standard_Real y = origin.Y() + j * 2;
Standard_Real z = origin.Z();

BRepPrimAPI_MakeBox B(gp_Pnt(x, y,z), 2, 2, 1);
Handle(AIS_Shape) aisShape = new AIS_Shape(B.Shape());
myAISContext->Display(aisShape, Standard_False);
}
}
myAISContext->UpdateCurrentViewer();
Fit();

"myAISContext->RemoveAll()" does not free the memory?

Thanks.

Attachments: 
gaog_90966's picture

I have set the environment variable MMGT_OPT=0, but there is still some increase in memory.
PS. I am using OCC6.5.1

Any suggestion is highly welcomed.

Forum supervisor's picture

Dear GaoGuang,
The provided example is not consistent as it has no link with the mentioned document
(which you mentioned before).
Provide, please some simplified sample which can be executed.
We will try to reproduce the problem.
Regards

gaog_90966's picture

Thanks supervisor.

The attached file is a simpler demo(just build it). Try to run"Test->OCCT Memory" several times, then see memory increase in task manager.

project name: OCCTMemory, vc10 win32, release
OCC ver : OCC 6.5.1
os : windows 7 32

Regards

gaog_90966's picture

Thanks supervisor.

The attached file is a simpler demo(just build it). Try to run"Test->OCCT Memory" several times, then see memory increase in task manager.

project name: OCCTMemory, vc10 win32, release
OCC ver : OCC 6.5.1
os : windows 7 32

Regards

Attachments: