
Wed, 04/29/2009 - 11:16
Forums:
Hi all,
I have a giant memory leak and don't know how to solve: When I open an OCAF document and close it in the very next step again, I can see with the help of a profiler (AQTime) that not even half of the allocated memory is released. There are no steps in between and I hold no references to any objects of the document. When opening and closing the same document again and again, I run out of memory. I use OCC6.1.
- Can anyone confirm this behaviour?
- If so, can this problem be fixed by upgrading to OCC6.3?
Any other help is very welcome.
Thanks in advance.
Wed, 04/29/2009 - 11:35
I can confirm this behavior using version 6.3. I have written a little about this in the thread http://www.opencascade.org/org/forum/thread_13874/ . Additionally the unreleased memory is a lot larger when you display shapes from the document. I have no clue how to fix this.
Dirk
Thu, 05/07/2009 - 21:25
Try to look at http://opencascade.blogspot.com/2009/03/unnoticeable-memory-leaks-part-1...
Fri, 05/08/2009 - 13:34
Thanks for this hint.
The point of this blog entry is to call the application's close method what I already do. The code I use to produce the memory leak looks like this:
Handle_OcafApplication myOwnOcafApplication = new OcafApplication();
TCollection_ExtendedString ocafFile = ""; // here goes the path of some ocafFile
for(int i=0; i<50; i++)
{
{
Handle_TDocStd_Document docHandle;
myOwnOcafApplication->Open(geometryFile, docHandle);
myOwnOcafApplication->Close(docHandle);
}
// here the scope of docHandle ended and all memory should already be released
}
I just found out another detail: When using OCAF files with a size of about 100KB, the memory is indead released. But when files are about 10MB, the memory leak will occur.