> Enrico wrote:
>  > Hi carsten,
>  >
>  > I did a bit of debug and here is what i found:
>  > My pseudo code sounds like
>  >
>  > Node = dbTreeRoot->clone
>  >
>  > SceneRoot->addChild (Node);    -- memory raises about 2000K
>  >
>  > <Do stuff>
>  >
>  > For (int i=0;i<SceneRoot->getNchildren;i++)
>  > sceneRoot->subChild(0)         -- memory lower about 500k
>  >
>  > Node = dbTreeRoot->clone
>  > SceneRoot->addChild (Node);    -- memory raises about 2000K
>  >
>  > And so on
>  >
>  >
>  > So I am leaking 1500K at every round. (obviously this value increases
> as the
>  > model cloned raises in complexity).
> 
> hm, that doesn't sounds very good. Do you render in Do Stuff? What happens
> if
> you don't? I'm trying to see whether the lost memory is in OpenGL dlists
> that
> fail to be deleted, as the scene graphs refcounting has been working fine
> so
> far. If you're running on Linux, I'd recommend running the program through
> valgrind to find memleaks pretty reliably.



Imagine this: You have an interactive fish tank modeller, that works
like this: Let's say you have an editor for fish where you can define the
geometry of you fish, textures and so on. The editor is running in it's
own OpenGL context (and thus in it's own OSG-Window). Secondly, you have
an editor for fish swarms where you can create fish swarms using fish from
your database. This editor again runs in a different ogl-osg context.
In the fish swarm composing editor you use cloned nodes from the NodePtr's
coming from the fish editor context. Is the concept clear?

If everything was one osg context I'd expect that OpenSG recycles the
display lists from the original nodes when I call "clone". But given
that you create the clone in a different context my guess is that the 
display list is created once again in the new context. But what happens
if I create 1000 clones of the same fish instance? Does it reallocate
all the gl stuff for every new cloned instance? 

Regards,

  Toni


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to