Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2010-03-03 Thread Robert Osfield
Hi Ryan,

Today I checked changes to the DatabasePager to use a custom observer_ptr<>
rather than a ref_ptr<> with the intention of fixing the outstanding issues
with the pager such as the ones you've observered with multiple views.

Could you please test the svn/trunk version of the OSG and see if the issue
has been addressed for you app?

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-12-04 Thread Ryan Surkamp
Greetings,

Forgot to mention that I have three hacks that fix/minimize the issue:

Hack #1: Check for duplicates when adding PagedLod to the activeLODList in
FindPagedLODsVisitor. If a duplicate is found it is removed. This code
helped determine if there are duplicates.

Hack #2: In the Terrapage plugin TXPNode::updateScenegraph do the following:
If the node being removed has a child, get it and see if it is a TXPPagedLod
If the child node is a TXPPagedLod, check the tileIdentifier to see if it a
lod 0 node.
If the node is LOD 0, then setup the parameters such that the node will be
paged out by the database pager.  Note that TXPReaderWriter can be edited to
add the filename for LOD 0 tiles.

Hack #3: Put a check in FindPagedLODsVisitor if the PagedLod should be added
to the active list.  Don't add the PagedLod node to the activeLodList if it
shouldn't be.  This requires adding a parameter to the PagedLod node and
editing the ReaderWriter to set that parameter correctly.

Don't have the hacked up code ATM, but I could send it if needed(it's at
work).  It's pretty simple but all seems hackish. As for the orginal
question, it doesn't seem that the tilemanager supports multiple cameras.  I
could see the LOD 0 nodes being paged in and out a lot if multiple cameras
are used.

This was all based on osg 2.8.1 / 2.8.2.

I've just started looking at this code late this week, because it became top
priority bug. If any one has any idea of how to fix the issue properly, I
may be able to invest some time if others cannot.

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


[osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-12-04 Thread Ryan Surkamp
Debugging terrapage plugin results:

We've been seeing the same problem with a single camera moving around in the
database.

Here's what I've been seeing:
TXPNode::traverse -> this handles the unloading and loading of LOD 0 tiles.

When loading a tile here's what I see:
When the tile has no other lods, lod 0 node will be loaded (just a geode
node) and attached to a PagedLod node under the TXPNode.
So TXPNode -> PagedLOD -> geode
When the tile has other lods, the lod 0 node will be loaded (TXPPagedLod),
added to the activeLODList in the databasepager, and attached to the
scenegraph.
So it goes TxpNode -> PagedLod -> TXPPagedLod -> geode group -> (geode
group, TXPSeamLOD) etc
*Note that these nodes added to the activeLODList will never be expired by
the databasepager, they will always be in the activelodlist unless you clear
it out.
[I'm assuming the difference is that the tile has other LODs and the other
doesn't, haven't confirmed this.  All I can confirm is that they are lod 0
nodes and their scene graph structures differ.]

The Traverse also unloads the LOD 0 nodes (The PagedLOD nodes under the
TXPNode).  This works fine for the nodes that don't have any other LODs, but
not so well for the Nodes that have other lods / seams.
When the traverse removes a PagedLOD that has a TXPPagedLOD in it, the
database pager never expires that node and never removes it form the active
list. So it hangs around in memory never to be used again.
When that same tile is reloaded, the newly loaded node is pushed onto the
activeLODList and then added to the scenegraph by the database pager.  So if
you are constantly paging LOD 0 nodes in and out by moving around, you'll
eventually run out of memory and crash.

So what we are seeing is that duplicate LOD 0 nodes are being loaded.  I
currently don't have a fix for this, but would like to know what would be
the preferred way of fixing this issue?

The database version is Terrapage 2.2 I believe with 1600 LOD 0 nodes.
Other LODs are present in certain areas.

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-11-25 Thread Robert Osfield
Hi All,

I've now checked in the new testbed example, osgmultiviewpaging, for
sorting out database paging.  It's just a first cut so far, but I'll
add to it as we go on.  An svn update will get this example.

This example we'll need to add support for specifying animation paths
for each of the views, and then share animation paths/datasets details
that enable us to reproduce the memory issues.  I need members of the
community to pitch in with the testing.

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-11-25 Thread Robert Osfield
Hi Michael,

On Wed, Nov 25, 2009 at 9:13 AM, Michael Bach Jensen  wrote:
> You are free to use my code as you wish :-)

Thanks.

> Do I need to download anything extra wrt the earth.ive you linked to? It does 
> not contain any PagedLOD nodes (at least the statistics view does not report 
> any), and so will not have any issues.

No, it should just work as is - as long as you have the curl plugin
compiled that is..  The curl plugin does the reading from .ive.


The top most tile database will contain lowest level of detail for the
earth and then a nested PagedLOD that invokes the loading of
subsequent tiles/

> Thanks for looking into the issue and thanks for a great scene graph, btw!

Thanks "great scene graph" but not quite "great" enough - just got fix
those darn bugs first :-)

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-11-25 Thread Michael Bach Jensen
Hi, Robert!

You are free to use my code as you wish :-)

Do I need to download anything extra wrt the earth.ive you linked to? It does 
not contain any PagedLOD nodes (at least the statistics view does not report 
any), and so will not have any issues.

Thanks for looking into the issue and thanks for a great scene graph, btw!

Cheers,
Michael

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-11-24 Thread Robert Osfield
Hi Sergey et. al,

I'm finally getting back ontop of my submissions backlog and will be
allotting time this week to investigating outstanding issues.  The
DatabasePager issue being one of them.  The first step for me is
recreating the issue so I've got your main.cpp example up and
compiling under my system, and tested it out against the VPB built
example database up on osg-users:

   http://www.openscenegraph.org/data/earth_bayarea/earth.ive

I've also integrated Michael Bach Jensen's suggested custom MyPager to
keep tabs on memory growth.  I'll add more stats to this as well.

My thought is that it'd be worth using this code as a basis for a new
OSG example that can be used as testbed for reproducing, debugging and
then an ongoing unit test.  Are you happy for the code to be used/open
sourced in this way?

My second thought is that we'll need to use a common database or set
of databases and record camera paths for each of the windows to force
the same conditions so that we can measure before and after results as
we adjust values/algorithms/"fix" bugs.   Are you able to reproduce
the problem with the above database?

The issues with TXP databases will also need a TXP database.  Ideally
also so expertise from TerraPage guys if any are left as the code base
is primarily written by them.  I know a lot of them lots jobs when the
various buyouts happened so I know if there is anybody else left to
help out.  Is there anybody out there on support?

Robert.

On Mon, Oct 19, 2009 at 3:28 PM, sergey leontyev  wrote:
> I have created an example for the memory growth problem.
>
> If you have a chance can you please run it with the following command 
> arguments :
> " -3", where  is your database main txp file.
>
> It creates 3 views. In order to trigger the memory growth problem.
> First get closer to the terrain slowly ( so it appears) for lets say 2 bottom 
> views.
> Tilt the camera so it looks down at the terrain. Dont do anything else and 
> watch the memory growth.
> If memory usage is not growing, try to navigate camera to different places 
> and zoom out further.
>
>
> Thank you!
>
> Cheers,
> sergey
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=18396#18396
>
>
>
>
>
> ___
> 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] Databasepager + multiple views + different camera positions = memory leak?

2009-11-11 Thread Michael Bach Jensen
Hi everyone!

This is a tough one. I'm now certain that there is more than one bug at large 
here! At least one in the pager (the one mentioned in the PagedLOD experts 
thread) and at least one in the txp plugin.

The one I have been chasing for the past 2 days is within the txp plugin and  
looks more like a design issue than a bug. I don't think the txp plugin was 
designed with multiple cameras in mind!

The TXPNode (the top level node when loading a .txp archive) updates the camera 
position in _pageManager on every cull visit (through updateEye). Since there 
is one cull visit per camera per frame, the page manager position jumps between 
multiple positions every frame. Every time the position changes, the set of 
LOD0 nodes is reconsidered. This results in multiple cameras fighting over 
which set of LOD0 nodes should be present. Note that LOD0 nodes, or blocks, 
become children of the TXPNode in the update stage.

At some point, a state is achieved in which a certain number of nodes end up on 
the _nodesToAdd list and the same amount of nodes end up on the _nodesToRemove 
list. Unfortunately, some of the nodes on the remove list are not actually in 
the _children list, so the net result is that more nodes are added than 
removed. This happens every frame, so the number of children of the TXPNode 
increases indefinitely. Since these children are PagedLOD nodes, they, in turn, 
also start loading in children until all memory is exhausted.

It seems to me as though a major overhaul is needed for the txp plugin to be 
able to handle multiple cameras. As I mentioned earlier, one workaround is to 
make sure that each TXPNode is only visited by one camera - for instance by 
loading the terrain anew for each camera.

Cheers,
Michael
[/list]

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-11-09 Thread David Glenn

> BTW are aware of any publicly available Terra Page terrain?


Off hand I'm not sure that there is any! Have you tried contacting Presagis? 
Thay have the rights for  Terra Page and might have a sample.

I'm about to challange Presagis to make a "ive" output for there TerraVista 
program.  

I haven't tryed to generate any TerraPage terrain using TerraVista, hince I 
don't have anything to give. 

All the terrain that I'm alowed to make at the moment is OpenFlight. 

FYI: TerraVista generated terrain (that is made to OpenFlight) works well in 
OSG (after it is converted to an ive file).


D Glenn

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-11-04 Thread sergey leontyev
Wojtek,
I tried what you suggested.  Unfortunately it did not solve the problem :-(
Does this look like what you were referring to?

osg::ref_ptr opt = new 
osgDB::ReaderWriter::Options;
opt->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE);
osgDB::Registry::instance()->setOptions(opt.get());
terrain = osgDB::readNodeFile(path);


thanks for the try anyways:-). 

Sergey

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-20 Thread sergey leontyev
Hi,
 :-*  looks like I did forget to attach the file,
Thank you!

Cheers,
sergey

BTW are aware of any publicly available Terra Page terrain?

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



/* OpenSceneGraph example, osgcompositeviewer.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the "Software"), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

#include 

#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 

#include 
#include 
#include 
#include 

#include 

#include 

#include 


int main( int argc, char **argv )
{

// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);

// read the scene from the list of file specified commandline args.
osg::ref_ptr scene = osgDB::readNodeFiles(arguments);

if (!scene)
{
std::cout << argv[0] << ": requires filename argument." << std::endl;
return 1;
}

// construct the viewer.
osgViewer::CompositeViewer viewer(arguments);

if (arguments.read("-3") || viewer.getNumViews()==0)
{

osg::GraphicsContext::WindowingSystemInterface* wsi = 
osg::GraphicsContext::getWindowingSystemInterface();
if (!wsi)
{
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface 
available, cannot create windows."x = 100;
traits->y = 100;
traits->width = 1000;
traits->height = 800;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());
if (gc.valid())
{
osg::notify(osg::INFO)<<"  GraphicsWindow has been created 
successfully."setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
else
{
osg::notify(osg::NOTICE)<<"  GraphicsWindow has not been created 
successfully."setSceneData(scene.get());
view->getCamera()->setName("Cam one");
view->getCamera()->setViewport(new osg::Viewport(0,0, 
traits->width/2, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get());
view->getDatabasePager()->setTargetMaximumNumberOfPageLOD(0);

// add the state manipulator
osg::ref_ptr statesetManipulator = new 
osgGA::StateSetManipulator;

statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());

view->addEventHandler( statesetManipulator.get() );

view->addEventHandler( new osgViewer::StatsHandler );
view->addEventHandler( new osgViewer::HelpHandler );
view->addEventHandler( new osgViewer::WindowSizeHandler );
view->addEventHandler( new osgViewer::ThreadingHandler );
view->addEventHandler( new osgViewer::RecordCameraPathHandler );
}

// view two
{
osgViewer::View* view = new osgViewer::View;
view->setName("View two");
viewer.addView(view);

view->setSceneData(scene.get());
view->getCamera()->setName("Cam two");
view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, 
traits->width/2, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get());
view->setCameraManipulator(new osgGA::TrackballManipulator);
view->getDatabasePager()->setTargetMaximumNumberOfPageLOD(0);

}

// view three
{
osgViewer::View* view = new osgViewer::View;
view->setName("View three");
viewer.addView(view);

view->setSceneData(scene.get());

view->getCamera()->setName("Cam three");
view->getCamera()->s

Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-19 Thread J.P. Delport

Hi Sergey,

did you forget to attach it?

jp

sergey leontyev wrote:

I have created an example for the memory growth problem.

If you have a chance can you please run it with the following command arguments 
:
" -3", where  is your database main txp file.

It creates 3 views. In order to trigger the memory growth problem. 
First get closer to the terrain slowly ( so it appears) for lets say 2 bottom views.

Tilt the camera so it looks down at the terrain. Dont do anything else and 
watch the memory growth.
If memory usage is not growing, try to navigate camera to different places and zoom out further. 



Thank you!

Cheers,
sergey

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





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-19 Thread sergey leontyev
I have created an example for the memory growth problem.

If you have a chance can you please run it with the following command arguments 
:
" -3", where  is your database main txp file.

It creates 3 views. In order to trigger the memory growth problem. 
First get closer to the terrain slowly ( so it appears) for lets say 2 bottom 
views.
Tilt the camera so it looks down at the terrain. Dont do anything else and 
watch the memory growth.
If memory usage is not growing, try to navigate camera to different places and 
zoom out further. 


Thank you!

Cheers,
sergey

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-16 Thread sergey leontyev

robertosfield wrote:
> Hi Sergey,
> 
> On Tue, Oct 13, 2009 at 11:41 PM, sergey leontyev <> wrote:
> I don't have any ideas why this occurring.  One would expect the
> number of nodes to increase when you move to the new camera positions
> but "should" settle down quite quickly once all the require nodes are
> paged in.  Do you see any visual difference in the scene when the
> number of LODs increase?
> 
> Also could you modify one of the OSG examples to illustate the problem
> you are seeing and then publish this so others like myself can test
> against.
> 
> Robert.
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


Robert,
I don't see any visual changes, it appears to be fully loaded. With everything 
shown with the highest detail. 
Sure, i can modify an example to try to replicate the problem. I will try to do 
it right now.

Thanks!
Sergey

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-16 Thread Robert Osfield
Hi Sergey,

On Tue, Oct 13, 2009 at 11:41 PM, sergey leontyev  wrote:
> Robert and others,
> I checked the stats as you recommended. What I see is that "LOD" value for 
> both cameras is increasing when nothing in the application is changing. The 
> same is true for the "CULL" value. No other values change by any significant 
> amount, but LOD and CULL increase indefinitely. Any ideas

I don't have any ideas why this occurring.  One would expect the
number of nodes to increase when you move to the new camera positions
but "should" settle down quite quickly once all the require nodes are
paged in.  Do you see any visual difference in the scene when the
number of LODs increase?

Also could you modify one of the OSG examples to illustate the problem
you are seeing and then publish this so others like myself can test
against.

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-13 Thread sergey leontyev
Robert and others,
I checked the stats as you recommended. What I see is that "LOD" value for both 
cameras is increasing when nothing in the application is changing. The same is 
true for the "CULL" value. No other values change by any significant amount, 
but LOD and CULL increase indefinitely. Any ideas
Thanks
Sergey

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-10 Thread Robert Osfield
HI Sergey,

On Sat, Oct 10, 2009 at 12:03 AM, sergey leontyev  wrote:
> Robert,
> I tried the 2.9 trunk code with.
> osg::DisplaySettings::instance()->setMaxTexturePoolSize(1);
> osg::DisplaySettings::instance()->setMaxBufferObjectPoolSize(2);
>
> The problem still exists. As memory usage was growing and growing. I just 
> left the computer running and observed the linear memory consumption growth.

Was it a growth at the same rate, lower rate?  I'm afraid I don't
really have any ideas at the cause so it's a case of continuing to
profile to pinpoint the what is behind the growth.

You could try setting the above two values to 1 which forces the GL
object pool managers to try to minimize the about of GL memory used
without forcing objects from the same frame to be reused.  This might
isolate the area that is causing the memory growth better.

I would recommend using the on screen stats and monitor just how many
nodes are being maintained in memory.  It could be that some
combination of view points is causing the abnormally large scene graph
size to be loaded and kept in memory.

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-09 Thread sergey leontyev
Robert,
I tried the 2.9 trunk code with.
osg::DisplaySettings::instance()->setMaxTexturePoolSize(1);
osg::DisplaySettings::instance()->setMaxBufferObjectPoolSize(2);

The problem still exists. As memory usage was growing and growing. I just left 
the computer running and observed the linear memory consumption growth.



Thanks
Sergey

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-09 Thread Ralf Stokholm
Hi All

Just wantet to add that we are also using Delta3d and as a consequence we
are using the composite viewer.

Brgs.

Ralf Stokholm

2009/10/8 Michael Bach Jensen 

> Hello everyone,
>
> We are having the exact same problem at our company for quite some time
> (currently on osg 2.8.0 via Delta3D and using TerraPage terrains). I have
> verified that viewing the terrain in the osgViewer works fine, but in our
> app, which also uses multiple cameras, the memory-keeps-growing-until-crash
> issue occurs when the cameras are not looking at the exact same thing (have
> the same projection and view matrices with the same LOD scale). The more
> different they are, the easier it is to trigger the issue, it seems.
>
> What we did to work around the issue, is to make sure that no two cameras
> in the graph render the same PagedLOD node. That is, we load the terrain
> multiple times using osgDB::readNodeFile and point each camera to each
> instance.
>
> I hope this helps on shedding some light on what is going on.
>
> Additional info:
> Delta3D design currently limits OSG to single-threaded mode. I am on
> WindowsXP, using an NVidia card, not that I think that makes a difference.
>
> I also seem to recall, that the active lod node list in the pager starts to
> grow rapidly when I put the second camera into the scene graph at runtime.
>
> Cheers,
> Michael
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=18075#18075
>
>
>
>
>
> ___
> 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] Databasepager + multiple views + different camera positions = memory leak?

2009-10-08 Thread Michael Bach Jensen
Hello everyone,

We are having the exact same problem at our company for quite some time 
(currently on osg 2.8.0 via Delta3D and using TerraPage terrains). I have 
verified that viewing the terrain in the osgViewer works fine, but in our app, 
which also uses multiple cameras, the memory-keeps-growing-until-crash issue 
occurs when the cameras are not looking at the exact same thing (have the same 
projection and view matrices with the same LOD scale). The more different they 
are, the easier it is to trigger the issue, it seems.

What we did to work around the issue, is to make sure that no two cameras in 
the graph render the same PagedLOD node. That is, we load the terrain multiple 
times using osgDB::readNodeFile and point each camera to each instance.

I hope this helps on shedding some light on what is going on.

Additional info:
Delta3D design currently limits OSG to single-threaded mode. I am on WindowsXP, 
using an NVidia card, not that I think that makes a difference.

I also seem to recall, that the active lod node list in the pager starts to 
grow rapidly when I put the second camera into the scene graph at runtime.

Cheers,
Michael

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-07 Thread sergey leontyev
Hello,

I am happy to see that others have the same problem, which means I am not crazy 
:-). I am going to try to port my application to trunk verstion of the OSG and 
to see if this issue was solved.



Cheers,
sergey

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





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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-07 Thread Robert Osfield
Hi Ralf.

On Wed, Oct 7, 2009 at 10:33 AM, Ralf Stokholm  wrote:
> I was wondering if somthing in the database pager is preventing the release
> like a copy of a refptr or similar?

I believe this would be very unlikely.  There is no special handling
of multiple view points, and there needn't be as the DatabasePager
page is designed to be completely agnostic to the number of views.

I would recommend investigating just how many nodes are kept in
memory.  I also strongly recommend trying another OS.  Vista can be a
real problem w.r.t graphics memory managent.

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-07 Thread Ralf Stokholm
Hi Robert

Unfortunatly I cant upgrade to trunk without a considerable effort, so that
wont happen right now. But the texture pools looks really interesting with
regards to large paged terrains.

I doubt if its a driver thing directly, as Im able to run osgviewer on the
same dataset without problems, if i for instance move far away from the
terrain memmory will drop etc. If I do the same in my application moovi both
cameras far away from the paged data wont result in the same drom in mommory
consumption.

These observations are done in windows task mgr so they might not be
completely valid, but the end result is that if i fly back and fourth usin
the viewer it will never chrash, if I do it using my application it will
eventually chrash, this might well be me screwing up somewhere else but it
supports the observations Sergey are making.

Database is VPB database app 500 Gig
OSG 2.8.2
Windows vista and XP Nvidia GTX280 Graphics latest drivers.

I was wondering if somthing in the database pager is preventing the release
like a copy of a refptr or similar?

Brgs
Ralf
2009/10/7 Robert Osfield 

> HI Sergey and Ralf,
>
> I haven't seen this behavior in the DatabasePager before, and it might
> not be directly related to the DatabasePager at all.  The
> DatabasePager itself doesn't actually know anything about cameras, it
> just handles requests made to it from the cull traversals.  The code
> for handling the requests is thread safe so there should be no problem
> with having multiple cameras making multiple requests.
>
> If you do have multiple cameras then you will naturally be requiring
> more data to be loaded into memory, and less data will able to be
> expired than normal.  Whether this can explain the growth in memory
> you are seeing I would doubt though.  Perhaps the OpenGL drivers is
> playing tricks.  If you can try your app on a different
> OS/driver/hardware combination to see if the same behavior exists.
>
> Another thing you could try is the svn/trunk version of the OSG as it
> now contains and texture and buffer object pool mechanism that you can
> turn on that will keep a lid on how much OpenGL memory you're app is
> using and might just be what you need.
>
> Robert.
>  ___
> 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] Databasepager + multiple views + different camera positions = memory leak?

2009-10-07 Thread Robert Osfield
HI Sergey and Ralf,

I haven't seen this behavior in the DatabasePager before, and it might
not be directly related to the DatabasePager at all.  The
DatabasePager itself doesn't actually know anything about cameras, it
just handles requests made to it from the cull traversals.  The code
for handling the requests is thread safe so there should be no problem
with having multiple cameras making multiple requests.

If you do have multiple cameras then you will naturally be requiring
more data to be loaded into memory, and less data will able to be
expired than normal.  Whether this can explain the growth in memory
you are seeing I would doubt though.  Perhaps the OpenGL drivers is
playing tricks.  If you can try your app on a different
OS/driver/hardware combination to see if the same behavior exists.

Another thing you could try is the svn/trunk version of the OSG as it
now contains and texture and buffer object pool mechanism that you can
turn on that will keep a lid on how much OpenGL memory you're app is
using and might just be what you need.

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


Re: [osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-06 Thread Ralf Stokholm
Hi Sergey

Im afraid I dont have an answer, but I can back up your observations.

We are using two cameras for our application one for a standard view the
other for an IR targeting POD. The two cameras are looking in opposite
directions and have different lodscales.

I have also notised that the memmory usage keeps rising untill the app
chrashes and that this will happen faster if the IR camera is zoomed with
according lodscale.

I have tried various settings for the database pager, but the problem
remains.

Brgs.

Ralf Stokholm




2009/10/7 sergey leontyev 

> Hello,
>
> (i am using OSG 2.8.2)
>
> Let me try to explain the problem :
>
> I have a big database (TerraPage).  I load it into my application. I have
> two views (cameras) within a window and i can position each camera
> individually looking directly down at the terrain ( I am using orthographic
> projection ). If I move 2 cameras to an identical location everything is
> fine, and I can keep moving them to the same position.
>
> However, when i move them to a different locations ( looking at different
> tiles i presume). The memory usage starts to increase at about 0.5mb per
> second and never stops. It seems to only happen when i use setViewAsLookAt
> which changes the modelview matrix. I used to move around the map using the
> ortographic projection matrix(by setting left and right top and bottom
> params) i have never noticed the memory increase.
>
> In other words it seems that having 2 views with cameras positioned in
> different places break something in the databasepager.
>
> I have tried playing with some settings such
> setTargetMaximumNumberOfPageLOD or calling clear on the database pager. Does
> anyone have or had similar issues? I have no idea how to debug this. Is what
> i am saying possible? and the databsepager has a bug?
>
> Does anyone have any ideas? How to debug this? How to rule out the that
> there is a bug in databasepager?
>
> Any help or advices are appreciated.
> Thanks!
> Sergey
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17989#17989
>
>
>
>
>
> ___
> 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


[osg-users] Databasepager + multiple views + different camera positions = memory leak?

2009-10-06 Thread sergey leontyev
Hello,

(i am using OSG 2.8.2)

Let me try to explain the problem :

I have a big database (TerraPage).  I load it into my application. I have two 
views (cameras) within a window and i can position each camera individually 
looking directly down at the terrain ( I am using orthographic projection ). If 
I move 2 cameras to an identical location everything is fine, and I can keep 
moving them to the same position.  

However, when i move them to a different locations ( looking at different tiles 
i presume). The memory usage starts to increase at about 0.5mb per second and 
never stops. It seems to only happen when i use setViewAsLookAt which changes 
the modelview matrix. I used to move around the map using the ortographic 
projection matrix(by setting left and right top and bottom params) i have never 
noticed the memory increase. 

In other words it seems that having 2 views with cameras positioned in 
different places break something in the databasepager.  

I have tried playing with some settings such setTargetMaximumNumberOfPageLOD or 
calling clear on the database pager. Does anyone have or had similar issues? I 
have no idea how to debug this. Is what i am saying possible? and the 
databsepager has a bug?

Does anyone have any ideas? How to debug this? How to rule out the that there 
is a bug in databasepager?

Any help or advices are appreciated.
Thanks!
Sergey

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





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