ModelLayer memory error

classic Classic list List threaded Threaded
4 messages Options
lher86 lher86
Reply | Threaded
Open this post in threaded view
|

ModelLayer memory error

I'm working in a project that represents multiples roads in a landscape. I add an ElevationLayer with a custom TileSource, a few ImageLayers (gdal), a lot of MaskLayers and many ModelLayers that represents the road surfaces.

When I work with a few roads the projects works fine, but if i use a lot of roads it produces aleatory access errors (0xC0000005) always when the application tries to use as a LayerPointer, a pointer from the LayerVector return from map->getLayers.

    LayerVector layers;
    map->getLayers(layers);

    for (LayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)
    {
        Layer* layer = i->get();
        if (layer->getEnabled())   // access error

If you run the application again, this same error appears with another random pointer of the vector.

I'm using:

VisualStudio 15 64 bits
OSGEarth 2.10
OSG 3.6.3
Geos 3.7.2

I attach an output trace.osgTrace.txt

I'd appreciate some help.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: ModelLayer memory error

lher86,
Are you accessing the Map only from the main thread (or OSG's event/update traversal)?
Can you produce a Debug-mode stack trace?
Glenn Waldron / Pelican Mapping
lher86 lher86
Reply | Threaded
Open this post in threaded view
|

Re: ModelLayer memory error

Hi Glenn:

I think I'm accessing the Map only from the main thread.

I believe that my problem would be when i try to create the node that represents the road. For each road I have points, triangles, normals and textures and I put them directly into a class (named  OSGAxeModelLayer) inherit from  class ModelLayer .  I do this because this layers doesn´t change and the interaction with the terrain is throw the MaskLayer of each road than go in other layers.

I enclose a small summary of what i am doing in case it would have been hepful.

Thanks


Luis


El 03/07/2019 a las 20:19, gwaldron [via osgEarth] escribió:
lher86,
Are you accessing the Map only from the main thread (or OSG's event/update traversal)?
Can you produce a Debug-mode stack trace?
Glenn Waldron / Pelican Mapping



If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/ModelLayer-memory-error-tp7592700p7592705.html
To unsubscribe from ModelLayer memory error, click here.
NAML

resume.txt (10K) Download Attachment
lher86 lher86
Reply | Threaded
Open this post in threaded view
|

Re: ModelLayer memory error

In reply to this post by gwaldron
Hi Glenn,

I changed my code in order the draw the road as a featureModelLayer but the results are the same. The software crash in the same position in the file engine_rex\TileDrawable

 for (LayerVector::const_iterator layer = layers.begin(); layer != layers.end(); ++layer)
                {
                    if (layer->valid())
                    {
         ->             layer->get()->modifyTileBoundingBox(key, bbox);
                    }
                }

I attach the calling stack in the moment of crash:

Trace.txt


Thanks

Luis