STEP loader and memory allocation

I'm developping a loader of Step file :

STEPControl_Reader reader;
Standard_Integer stat = reader->ReadFile("file.step");
Standard_Integer nb = reader.NbRootsForTransfer();
reader->TransferRoots ();
occgeo->shape = reader->OneShape();

No problem, it works, but the allocation of memory is really big (nearly 70Mo of RAM for a Step model of 6Mo). So imagine the memory size reserved for a bigger model...
It would be possible to deallocate memory after reading the file ?

I'm using OpenGl to display the shape with "TopTools_IndexedMapOfShape" and a triangulation of the differents faces, so I don't need the object "reader" neither the "shape".

Thanks for your help.
Jc.

Bearloga's picture

Hi,
Try setting environment variable before launching app:
MMGT_OPT=0
It will be slower but it will return all the memory to the system.

Simon Côté's picture

Hi Jean-Charles,
I just started my research to know how to import a STEP file in a 3D space that I will create further with OpenGL. It's look like you've done something witch appear like similar with what I plan to do. I wonder if you could give me some tips. At the far beginning, I’m searching for a description of the step file structure. I not able to find a copy of the ISO10303-21 norm, witch describe STEP file. Do you know where I could find information about STEP?

best regard,

Simon