Hi Tom,

I haven't heard of assigning an osg::Material as a cause of memory
growth before, and what you are doing sounds like it's something that
has been done with the OSG for over a decade, so my guess is that the
basic should be working just fine.  The three aspects that could be a
cause are a bug in the OpenGL driver, or a problem with the memory
usage tool reporting an problem, something in your own set up of the
material that is causing a leak.

For the later you'd need to be creating a new osg::Material quite
regularily and not using a ref_ptr<> to manage it, the OSG itself uses
ref_ptr<> consistently so once you assign it to the scene graph it
should just safely look after itself.

There isn't really a way for me to dig any further into the problem on
your system, try moving to another machine with a different graphics
card/driver/OS to see if that affects the problem you are witnessing.

Robert.

On Mon, Sep 20, 2010 at 10:06 PM, Tom Pearce <[email protected]> wrote:
> Hi OSGers,
>
> I'm using setAttribute(osg::Material* mat) on a matrix transform to control 
> the color of an object (just a simple sphere for now, nothing fancy).  Just 
> using task manager in windows to watch process memory usage, I noticed that 
> upon adding an object to the scene, the memory usage would start to creep 
> upward.  Thinking this was a leak of some kind in my application I looked 
> into it further and found that the creep (~20kB/sec) was dependent on calling 
> getOrCreateStateSet()->setAttribute(Material) for the first time - If I never 
> set a material, the memory usage stays constant.  When I wait for a key press 
> and then set the material, the creep starts right away.  If I remove the 
> node, the usage stops increasing but does not decrease.  Finally, if I just 
> let it run, after a while (~500kB worth) the memory usage plateaus and is 
> steady.
>
> I'm wondering if this something I should be worried about or not moving 
> forward, or if that just happens and it isn't really an issue... either way I 
> wouldn't mind knowing what's going on.
>
> Thank you!
>
> Tom
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=31866#31866
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to