MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #21142 All Revisions ] Back to Issue ]
Summary 0021142: Memory leaks using standard OCCT samples
Revision 2012-10-26 10:01 by szy
Description Minor problem with memory management in OCCT selection logic & sufficient
problems in MFC-based sample GUI(TopologyPrimitives).
------------------------------------------------------------------------------
Customer description:
--------------------
"I clicked on Box repeatedly and task manager showed memory increasing with each
click. Also when I clicked through all the options memory kept increasing
continuously. If I understand Memory optimization correctly, then application
should not allocate new memory block with each click on same icon but should use
memory from free list. Same is the problem with import-export sample when I keep
on importing same file and close the window repeatedly. This increases the
memory continuously. This is true with and without memory optimization i.e.
MMGT_OPT= 1 and 0 respectively."

OCN expert (SAN) analysis report:
--------------------------------
"Here some new analysis results based on TopologicalPrimitives sample:
- When an AIS_Shape instance is removed from the interactive context, and this
is not the presentation that has been highlighted with the mouse most recently,
both the AIS_Shape and the underlying TopoDS_TShape are correctly destroyed
after removing.
- When an AIS_Shape instance is removed from the interactive context, and this
is the presentation that has been highlighted with the mouse most recently, the
AIS_Shape instance is destroyed but the underlying TopoDS_TShape is not, due to
one reference kept inside OCCT selection mechanism (something like "last
highlighted entity owner"). However, this last reference is freed when the user
highlights something in the viewer again.
- Re-creating primitives in the sample multiple times do not lead to virtual
memory growth on my workstation.

Thus my conclusion is as follows:
there is a minor problem with memory management in OCCT selection logic, but it
is unlikely to result in significant memory leaks. The memory leaks reported by
the customer are therefore located somewhere outside OCCT visualization,
probably somewhere in MFC-based sample GUI. Visual Studio debugger reports
memory leaks even if the sample is started and then closed immediately without
any user actions."
Revision 2009-05-28 19:23 by szy
Description Minor problem with memory management in OCCT selection logic & sufficient
problems in MFC-based sample GUI(TopologyPrimitives).
------------------------------------------------------------------------------
Customer description:
--------------------
"I clicked on Box repeatedly and task manager showed memory increasing with each
click. Also when I clicked through all the options memory kept increasing
continuously. If I understand Memory optimization correctly, then application
should not allocate new memory block with each click on same icon but should use
memory from free list. Same is the problem with import-export sample when I keep
on importing same file and close the window repeatedly. This increases the
memory continuously. This is true with and without memory optimization i.e.
MMGT_OPT= 1 and 0 respectively."

OCN expert (SAN) analysis report:
--------------------------------
"Here some new analysis results based on TopologicalPrimitives sample:
- When an AIS_Shape instance is removed from the interactive context, and this
is not the presentation that has been highlighted with the mouse most recently,
both the AIS_Shape and the underlying TopoDS_TShape are correctly destroyed
after removing.
- When an AIS_Shape instance is removed from the interactive context, and this
is the presentation that has been highlighted with the mouse most recently, the
AIS_Shape instance is destroyed but the underlying TopoDS_TShape is not, due to
one reference kept inside OCCT selection mechanism (something like "last
highlighted entity owner"). However, this last reference is freed when the user
highlights something in the viewer again.
- Re-creating primitives in the sample multiple times do not lead to virtual
memory growth on my workstation.

Thus my conclusion is as follows:
there is a minor problem with memory management in OCCT selection logic, but it
is unlikely to result in significant memory leaks. The memory leaks reported by
the customer are therefore located somewhere outside OCCT visualization,
probably somewhere in MFC-based sample GUI. Visual Studio debugger reports
memory leaks even if the sample is started and then closed immediately without
any user actions."


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker