Skip to content

Memory Management Issue in Tiled Feature Model Layer #2884

@archiedavies75

Description

@archiedavies75

osgEarth Version (required): 3.7.2

Description of the problem

I'm experiencing a memory management issue when using a tiled feature model layer with ResampleFilter for LOD-based simplification. While the filter successfully reduces geometry complexity at lower Level of Details (LODs), I've discovered that the simplified geometry from lower LODs is being used as the base for further simplification at higher LODs, rather than resampling from the original feature geometry.

Current Behavior

  1. ResampleFilter is applied to simplify features at lower LODs (works as expected)
  2. As user zooms in and higher LODs are loaded, memory consumption increases significantly
  3. Higher LOD tiles appear to resample from the already-simplified lower LOD geometry instead of the original source geometry
  4. Lower LOD data is not being unloaded from memory when transitioning to higher LODs, causing memory to accumulate continuously
  5. This cascading simplification combined with memory retention results in progressive loss of detail and ever-increasing memory consumption

Expected Behavior
Each LOD level should apply ResampleFilter to the original, full-resolution feature geometry independently, and lower LOD data should be unloaded when no longer needed, ensuring:
Appropriate level of detail for each LOD
Lower LOD tiles are released from memory when higher LOD tiles are loaded
Predictable and bounded memory consumption patterns
No cumulative geometry degradation across LOD levels

Configuration Example

<FeatureModel>
    <features driver="ogr">
        <url>path/to/features.shp</url>
    </features>

    <styles>
        <style type="text/css">
            default {
                stroke: #ffff00;
                stroke-width: 2px;
            }
        </style>
    </styles>

    <filters>
        <resample min_length="10" max_length="50"/>
    </filters>
    
    <layout>
        <tile_size>1024</tile_size>
        <level name="0" max_range="50000"/>
        <level name="1" max_range="25000"/>
        <level name="2" max_range="10000"/>
        <!-- Additional levels -->
    </layout>
</FeatureModel>

Questions

  1. Is this the intended behavior of ResampleFilter across LOD levels?
  2. Is there a configuration option to ensure each LOD resamples from original geometry?
  3. Why are lower LOD tiles retained in memory when higher LOD tiles are loaded? Is there a paging/unloading mechanism that should be releasing them?
  4. Are there configuration parameters (e.g., cache size, tile expiry policy) that control memory management for tiled feature models?
  5. What's the recommended approach for managing memory growth in tiled feature models while maintaining geometry quality at higher LODs?
  6. Should I be using a different filter or combination of filters for this use case?

Additional Information
Any guidance on best practices for memory-efficient feature rendering with appropriate LOD management would be greatly appreciated.

Note: I can provide more specific configuration details, profiling data, or code samples if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportSupport questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions