For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Out of Memory Crash

Burak Canik's picture


I'm using OpenCascade to translate some geometry to .STEP format. Said geometry includes spheres with surfaces and holes cut in them, cone-like shapes (created by revolving a makewire face around an axis by 360 degrees), nuts, screws (composed of two cylinders) and pipes (outer cylinder minus inner cylinder).

I create this geometry using booleans and brepAPI facilities. After creating the geometry (residing in a std::vector< TopoDS_Shape >) I then translate each element in the std::vector like this:

status = stepWriter.Transfer( vec[ index ], STEPControl_AsIs, false );

Then I compute the graph.

stepWriter.WS()->ComputeGraph( Standard_True );

And at this line, application crashes. When I debug it, I see that it raises a "Standard_OutOfMemory" exception. I'm using TBB to parallelize the workload. I tried all MMGT_OPT options (0, 1, 2) but it doesn't solve the problem.

I also incresed the stack reserve and commit sizes to 15mb each. Still crashing.

My application is 32 bits. Current shape count of a project that crashes the app when writing .STEP is 29.096.

What can be done about this ?

P.S. : Also I added MMGT_OPT as a Windows environment variable. Is this how you define environment variables in opencascade ? Or did I get the concept of environment variables wrong ?