Hi Michael,

Michael Raab wrote:
> Hi all,
> 
> i'm using openSG 1.8 as basis for our vr application. When loading and
> unloading our scenarios i discovered some memory leaks. Searching in my
> source code helped not to close them. I wrote a small test benchmark in which
> i create 50000 objects where each object creates 3 opensg nodes, 1 transform
> core and 2 groups. After destroying my 50000 objects, the opensg nodes and
> cores are successfully destroyed, if i can trust the fc statistics
> (http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Memleak). So are there
> any known memory leaks that are caused by opensg?

First: how big is the memleak? But a few KB or does grow without bound?

In general OpenSG 1 handles cleanup reasonably well, as long as you use RefPtrs 
or manage the refcount yourself.

I see two possibilities:

- ChangeList is not cleared. If you set it to read/write at the beginning of 
the 
program you need to clear it occasionally or it will grow without bounds.
- FCFactory registry. The FCFactory keeps a registry, a simple vector, for all 
created FCs, which doesn't shrink when objects are deleted (to make sure IDs 
are 
unique). If you create this many objects regularly even a few bytes in that 
vector can add up.

Are you on Linux or Windows? If Linux I recommend running it through valgrind, 
which pretty reliably will find mem leaks. I don't know any equivalent tools on 
Windows though.

Can you send us your test program? We can give it a look and see if there is 
something unusual.

Yours

        Dirk

------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to