Anonymous | Login | 2021-01-23 14:42 MSK | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0011789 | Community | [OCCT] OCCT:Modeling Algorithms | public | 2006-03-03 11:33 | 2011-11-25 15:06 | ||||
Reporter | mkv | ||||||||
Assigned To | gka | ||||||||
Priority | normal | Severity | trivial | ||||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | All | OS Version | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | [OCCT] 6.1.1 | |||||||
Summary | 0011789: Several memory leaks in TopExp_Explorer methods Init and Clear. | ||||||||
Description | -------- Original Message -------- Subject: [OCC Forum] Memory leak in TopExp_Explorer Date: Mon, 16 Jan 2006 15:40:02 +0100 From: Christian R. Krug <Christian.Krug@pace.de> This message was sent from www.opencascade.org <http://www.opencascade.org> [^] forum. http://www.opencascade.org/org/forum/thread_9297/ [^] ------------------------------------------------------ Hi Everybody ! There is a severe memory leak in TopExp_Explorer methods Init and Clear. If the member field myTop is greater -1, resp. 0, the destructor for all TopoDS_Iterator's on the current stack is never called. For example in BRepLib_FindSurface the Init method for the same TopExp_Explorer is called repeatedly. This has the effect that the reference counter for the first edge of a given face is continuously increasing, and its memory can never be freed. I suspect, that one of the previous maintainance releases already incorporates a fix for this leakage. But for all non-commercial users of Open CASCADE, I give an outline of the solution to this problem. Modify Init and Clear methods so that the destructors get called: void TopExp_Explorer::Init(const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid) { if(myTop >= 0) for(int i = 0; i <= myTop; ++i) myStack[i].~TopoDS_Iterator(); myTop = -1; [...] } void TopExp_Explorer::Clear() { hasMore = Standard_False; if(myTop > 0) for(int i = 1; i <= myTop; ++i) myStack[i].~TopoDS_Iterator(); myTop = 0; } Both forms of the TopExp_Explorer constructor have to initialize the member fields: : myStack(0L), myTop(-1), mySizeOfStack(theStackSize) and ReInit needs only call Init: void TopExp_Explorer::ReInit() { Init(myShape,toFind,toAvoid); } Regards, Kris. ------------------------------------------------------ | ||||||||
Additional information and documentation updates | Documentation remark, added by gka 2006-08-25 10:28:55: Improvements: Added code removing previously created objects having type TopoDS_Iterator in the methods Init() and Clear(). | ||||||||
Tags | No tags attached. | ||||||||
Test case number | |||||||||
Attached Files | ![]() ![]() ![]() | ||||||||
![]() |
|
(0011305) aki (developer) 2006-03-07 12:21 |
Much regress in KAS:dev:OCC11789-opt regarding to Products. |
(0011309) aki (developer) 2006-03-22 17:35 |
No regress in KAS:dev:OCC11789-opt regarding to Products on sun. |
![]() |
|||
Date Modified | Username | Field | Change |
2006-03-06 16:48 | mkv | CC | => mkv |
2006-03-09 16:17 | bugmaster | groupset1 | => 4096 |
2006-03-09 16:17 | bugmaster | Customer | => Community |
2006-08-22 17:14 | bugmaster | Assigned To | bugmaster => gka |
2006-08-22 17:14 | bugmaster | Status | new => assigned |
2006-08-25 12:23 | gka | Status | assigned => resolved |
2006-08-25 19:28 | mkv | Status | resolved => tested |
2006-09-06 09:43 | bugmaster | Status | tested => verified |
2006-10-26 19:18 | bugmaster | Status | verified => closed |
2006-10-26 19:18 | bugmaster | Resolution | @0@ => fixed |
2011-08-02 11:31 | bugmaster | Category | OCCT:MOA => OCCT:Modeling Algorithms |
2011-11-23 18:09 | szy | Description Updated | View Revisions |
2011-11-23 18:09 | szy | Additional Information Updated | View Revisions |
2011-11-25 15:06 | szy | Summary | There is a severe memory leak in TopExp_Explorer methods Init and Clear. => Several memory leaks in TopExp_Explorer methods Init and Clear. |
Copyright © 2000 - 2021 MantisBT Team |