Hello Klaus,

Klaus Kesseler wrote:
> Hi Everyone,
> i recently have seen, that the SceneFileHandler in OpenSG 1.6 and OpenSG 1.8 
> is
> leaking. Executing the following code results in a file size dependend leak in
> each iteration. I've tried using VRMLs, 3DS and obj file with the same result.

it is entirely possible that there is some genuine leak, however most of
the reports in the past turned out to have different reasons. Therefore,
how much memory does leak and how do you diagnose it ?

> for (int i=0; i<10; i++)
> {
>       int refCount = 0;
>       RefPtr<NodePtr>tmp (SceneFileHandler::the().read(fileName.c_str()));
>       int doBreak = 0;
> }
> 
> Am i doing something wrong or do i have to live with these leaks?

OpenSG contains datastructures that grow over time: The changelists that
 keep track of modifications and a std::vector<FieldContainerPtr> in the
FieldContainerFactory that is used as a map from container id to the
actual thing.
The memory consumption of the changelist can be reduced by clearing it
regularly or if you are running single thread/non-cluster apps only by
leaving them read-only.
The vector in the FieldContainerFactory can not be made smaller and
although it could be replaced by some other datastructure that maps ids
to containers, that would lead to a performance hit for clusters as
these make heavy use of it. I'm not aware of any measurements on this,
so maybe we are just overly careful, but on the other hand it would
require huge numbers of containers before

fcStore.capacity() * sizeof(FieldContainerPtr)

(where std::vector<FieldContainerPtr> fcStore;) eats enough memory to be
a problem.

        Hope it helps,
                Carsten


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to