I'm currently trying to run a program that can fuse about 5000 solids and output them to an stl file. Currently the most I have gotten to work is 200 solids. I tried running the program on a set of 450 solids last night, but when I woke up I found that I had run out of memory. I am reading all of the TopoDS_Shape's into a build queue, and then taking the first two solids from the front of the queue, fusing them, and pushing them to the back of the queue. In this way I end up with a heap-like system of build up. I fear that I might not be freeing the memory from my BRepAlgoAPI_Fuse operations correctly. Here is the loop that fuse's the objects in the build queue:
// Construct the solid from the build queue.
TopoDS_Shape Alpha, Beta;
while (build_queue.size() > 1)
Alpha = build_queue.front();
Beta = build_queue.front();
// Fetching start time for union.
BRepAlgoAPI_Fuse boolOpUnion(Alpha, Beta);
// Fetching end time for union.
cout cout }
Is there anyway I can manually tidy up my memory usage after each iteration of the loop?