tangram-es icon indicating copy to clipboard operation
tangram-es copied to clipboard

Overzoom a vectorial layer produce memmory leaks (RAM consumptions for texture overzoom)

Open geocartosoft opened this issue 2 years ago • 6 comments

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

  • Take a vectorial layer set on low zoom (for example zoom 3 to 5) on a larger area with more textures like points, lines polygones. set max_zoom=5 (so Tangram ask tiles until zoom 5) and set max_display_zoom: 18 (to allow overzoom last tiles level until zoom 18)
  • Do repetitive zoom IN to zoom 18 and zoom out to zoom 3.
  • Observe RAM usage for Tangram. At each zoomIn/ZoomOut cycle RAM always increase until in the final reach the limit.

RESULT:

RAM usage increase over the expected limit. For a map of 300MB , Tangram go until 3.5 GB RAM usage.

EXPECTED RESULT:

We expect Tangram ES to not go over 600 -700 MB for a 300 MB RAM in worst case scenario,

ENVIRONMENT:

Linux UBUNTU 18, Run Tangram client available on GIT.

I'm not an expert but how much RAM can increase when Tagram load a map . Is there a way to limit the RAM usage (maybe a config params) to blok Tangram use RAM over a limit?

geocartosoft avatar Nov 05 '21 14:11 geocartosoft

Hi! Thanks for the report. This amount of RAM usage sounds like a bug. Do you have a scene file that demonstrates this problem that you can share?

matteblair avatar Nov 05 '21 17:11 matteblair

scene.zip

Here our scene sample. If we go to Max Zoom(18) and continue to zoom IN ..even the map not go deeper(Map remain on zoom 18 view) the RAM increase dramatically until consume all PC RAM (just overzoom continously from mouse wheel for few secs). Our vectorial layer contain many Point and geometries (marine objects) with lines , geometries, sprites,

I suspect is because textures overzoom at high zoom . If we build the vectorial layer to have tiles until zoom 10 instead (now is built until zoom 8), the leak is not anymore such quick visible (but if do many zoomIN/ZoomOut the leak, in time, is observable)

geocartosoft avatar Nov 25 '21 15:11 geocartosoft

About this issue I have something similar and discovered that set collide: true on labels and points objects create this memory leak. Setting collide: false will make the issue to not appear anymore. (even is not a fix is a indication about what could be the cause)

Cristian-Gabriel avatar Dec 02 '21 14:12 Cristian-Gabriel

I'm not sure if I can reproduce the exact issue you're reporting without having access to the tile data that you are using, but I am investigating what I can.

I did find and fix a bug that led to excessive memory use when overzooming, but I don't know if it was the same issue: https://github.com/tangrams/tangram-es/pull/2307

If you get a chance, please update your repo to the current version of main and let me know if the issue persists.

matteblair avatar Dec 02 '21 19:12 matteblair

In my case, this fix solve the problem. Thank you!

Cristian-Gabriel avatar Dec 09 '21 08:12 Cristian-Gabriel

The problem with zoom in-zoom out was solved, but I observed another problem. I have the same problem like @geocartosoft. If I navigate on the map from one side to the another and zoom in/out, the RAM memory only increases, without decreasing back.

Cristian-Gabriel avatar Jan 13 '22 12:01 Cristian-Gabriel