BRepBuilderAPI_Sewing memory leak??

Could someone help me? I used BRepBuilderAPI_Sewing in my application, to sew some faces, it works fine but it takes a lot of memory.
I executed my application with valgrind and I got this error:

==8650== 6,151,632 (66,144 direct, 6,085,488 indirect) bytes in 106 blocks are definitely lost in loss record 77,455 of 77,455
==8650== at 0x4A05140: calloc (vg_replace_malloc.c:418)
==8650== by 0x845298C: Standard_MMgrRaw::Allocate(unsigned long) (in /OpenCASCADE/ros/lib/
==8650== by 0xE81A89E: Standard_Transient::operator new(unsigned long) (Standard_Transient_proto.hxx:38)
==8650== by 0xE81ED6A: ROpenCC::CreateFaces(double*, int*, int) (ROpenCC.cxx:714)
==8650== by 0xE818465: OCCStep::BasicShape() (OCCStep.cxx:612)
==8650== by 0xE81955F: OCCStep::CreateOCCGeom() (OCCStep.cxx:134)
==8650== by 0xE819795: OCCStep::ReadRootGeom(char*) (OCCStep.cxx:171)

It is a memory leak.

In my code I just do:
BRepBuilderAPI_Sewing * sewing= new BRepBuilderAPI ();
While (face {myface=facecreation();
face++; }

So I used it to sew some faces and then I did:


But nothing change, after that the memory is not free!
what's wrong in my code??

Thank you

Denis Barbier's picture

No, this is not necessarily a memory leak, see documentation about the MMGT_OPT environment variable. You should re-run your test after setting it to 0.

Cinzia3's picture

Hi Denis,
thank you for the quickly answer. I setted MMGT_OPT=0 but nothing changed, i got the same error.
Any suggestion?
Thanks a lot