Re: [osg-users] StateSet setAttribute(Material) question

2010-09-21 Thread Robert Osfield
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 tmpea...@gmail.com 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
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] StateSet setAttribute(Material) question

2010-09-21 Thread Tom Pearce
Hi Robert,

I agree with your assessment of possible places to look.  This occurs even with 
creating a single new Material, and I always use ref_ptrs, so that isn't the 
source of it.  I'll look into drivers etc. and post anything I find here in 
case others come across the same issue.

Anybody out there have suggestions of a Windows process memory usage tracker 
that would be good to use?

Cheers,
Tom

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=31901#31901





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] StateSet setAttribute(Material) question

2010-09-21 Thread Jean-Sébastien Guay

Hi Tom,


Anybody out there have suggestions of a Windows process memory usage tracker 
that would be good to use?


Try Process Explorer. In the process list, right-click on your app and 
select Properties, and you'll be able to see detailed CPU and memory 
usage graphs and stats specific to that process (so it isn't drowned in 
info from all processes on your machine).


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] StateSet setAttribute(Material) question

2010-09-20 Thread Tom Pearce
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org