Hello Johannes,
On 12/13/2011 01:54 AM, Johannes Brunen wrote:
> I have integrated OpenSG into a dynamic link library which I use from my
> main application and from additional MFC dialogs. Now, I have detected
> memory leaks in the following application scenario(*):
[SNIP]
> Now, I'm detecting a lot of memory issues that look like the following
> (attached you will find all detections). The call stacks are taken at
> the time that the memory, which is not freed, was aquired in the first
> place. Any properly handled memory does not show up here.
>
> d:\_xxx\comp\intern\memmanager\leakdetect\leakdetect.cpp (80):
> LeakDetectMalloc
> d:\_xxx\comp\intern\memmanager\src\memmanagerimpl.cpp (445):
> MemMalloc
> d:\_xxx\install64\include\memmanager\newdeleteimpl.h (45): operator
> new
> c:\program files (x86)\microsoft visual studio
> 9.0\vc\include\xmemory (44): std::_Allocate<OSG::ContainerChangeEntry>
>
> c:\program files (x86)\microsoft visual studio
> 9.0\vc\include\xmemory (146):
> std::allocator<OSG::ContainerChangeEntry>::allocate
>
> c:\program files (x86)\microsoft visual studio 9.0\vc\include\vector
> (1173):
> std::vector<OSG::ContainerChangeEntry,std::allocator<OSG::ContainerChang
> eEntry> >::_Insert_n
>
> c:\program files (x86)\microsoft visual studio 9.0\vc\include\vector
> (719):
> std::vector<OSG::ContainerChangeEntry,std::allocator<OSG::ContainerChang
> eEntry> >::resize
each ChangeList instance maintains a pool of ContainerChangeEntry
objects that are allocated in blocks of 32. These only get free'd when
the ChangeList itself is destroyed, which happens when the owning
OSG::Thread object is destroyed. For the main thread that only happens
as part of osgExit().
> Most of the leaks are somehow related to the OpenSG ChangeList.
> Do you have an idea what I might doing wrong with operating the OpenSG
> framework?
Nothing AFAICT.
> How should I clean up things properly in order avoid memory leaks?
I wouldn't necessarily call these leaks, the memory is still accessible
and will be reused for future change entries.
Do you use multiple aspects in your application? If not you can make the
change list read only (ChangeList::setReadWriteDefault()), reducing the
number of needed CL entries, but some entries will still need to be
created for correct operation.
Do you call commitChangesAndClear() when you don't need the ChangeList
contents (for aspect/cluster sync) any more?
Cheers,
Carsten
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and
improve service delivery. Take 5 minutes to use this Systems Optimization
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users