Re: [osg-users] How to track down memory leaks?

2018-07-13 Thread Igor Spiridonov
Thank you Wojtek for your help. But as I see it's not so simple. In my program some objects in Update function have ref count 2 but some(surprise, surprise) 1. And memory consumption growing steadily and constantly. The interesting objects those that use vbo. If I set all objects to use

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Wojciech Lewandowski
Hi, Igor, I got interested in this problem and checked your code by converting it to pure osgViewer. Here are my observations: I believe you do have circular reference. Your class Scene is a callback. So RootNode points to callback but Scene callback points to RootNode. Hence circular ref.

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Igor Spiridonov
Here is simple project which reproduces this issue - RefCountTest (https://bitbucket.org/OmegaDoom/osgrefcounttest) It's a visual studio project with qt and osg. Not sure you are using windows but the main code in scene.cpp. ref count checks inside "Scene::operator()(osg::Node* node,

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Robert Osfield
On Thu, 12 Jul 2018 at 17:59, Igor Spiridonov wrote: > No, why would I have a circular reference? The OSG doesn't generally leak unless you do something pretty odd, the codebase is pretty heavily tested now. So we can only guess as to what might be wrong. Circular references is one

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Igor Spiridonov
No, why would I have a circular reference? And yes, I'm aware that circular references don't work with smart pointers. I will create a simple example which reproduces this issue. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=74328#74328

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Robert Osfield
Hi Igor, On Thu, 12 Jul 2018 at 16:24, Igor Spiridonov wrote: > I have found the memory leak cause. Look like I don't understand how osg > works. > I have a root node and its child node. I add UpdateCallback to the root node > and inside this callback i remove child nod's drawables and add

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Igor Spiridonov
Hello Robert. I have found the memory leak cause. Look like I don't understand how osg works. I have a root node and its child node. I add UpdateCallback to the root node and inside this callback i remove child nod's drawables and add another ones. I check reference count before I remove them

Re: [osg-users] How to track down memory leaks?

2018-07-11 Thread Robert Osfield
HI Igor, You don't provide enough information to know what might be causing the increasing in memory so we can't provide any specific guidance. In general the OSG's memory management is pretty solid, there are areas where data is cached either explicitly or implicitly due to restrictions due to

Re: [osg-users] How to track down memory leaks?

2018-07-11 Thread Sam Brkopac
Not really sure what you mean by memory leaks. If you don't want the cache to cache any objects then disable it. This will have the trade off of having to parse / upload a node every time you remove it and then re-add it. -- Read this topic online here:

[osg-users] How to track down memory leaks?

2018-07-11 Thread Igor Spiridonov
Hi. I'm facing memory consumption increase If I remove and create new nodes every frame. I don't have it if I use pools but this issue is nagging me anyway. Memory consumption increases gradually and does't stop although visually a scene looks ok and no lags. I have found this interesting