-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Memory use increases dramatically at high zooms, on iOS and Android #15022
Comments
@JesseCrocker thanks for reporting the issue with such a detailed analysis. I'm surprised that this is happening because the number if tiles on the map view is usually no bigger than a fixed number depending on the screen resolution and what adds to memory usage is the data density. After zoom level 16 I would expect memory usage to drop. |
@tmpsantos I've stumbled across the same issue. Is there an ETA on when this might be resolved? |
@bilaltawfic We will do our best to get started on this next week. |
By next week I mean monday :-) |
Amazing! Thanks! |
Link to related work mapbox/mapbox-gl-js#1898 |
Thanks for the help from @alexshalamov. In this case, the symbol layer source is line, and the label is rendered along the line. Before rendering the text label, Symbol Instance will be allocated for each anchor of the text label and a SymbolBucket will be created for holding all the SymbolInstances. The density of the label(number of anchors) is growing with regarding to the zoom level. Assuming zoom level change from 18 to 24, the number of the symbol instances will be increased by 2^6 times. The behavior is as expected, but there could be obvious optimization after mapbox/mapbox-gl-js#1898 is done. Another issue we found is the continuous memory growth in gl-native with regarding to symbol bucket. We are investigating it. |
Platform: iOS and Android
Mapbox SDK version: iOS 5.1.0, Android 8.0.0
Steps to trigger behavior
Expected behavior
Memory use remains constant, or decrease as map is zoomed past the max zoom of source in loaded style.
Actual behavior
Memory use starts to increases when the map has been zoomed about 6 levels past the max zoom of the source. Each additional zoom level causes memory use to incerease ~1.5 more than it did for the previous level. The increase in memory from 21 to 22 is frequently enough to cause the app to get killed.
I'm able to reproduce this behavior with multiple styles, including Mapbox outdoors. But it seems to have the most impact on styles where the max zoom of the sources is lower.
Here's a graph of memory use on iOS with a source with a max zoom of 12, labeled to show zoom events.
Here is a sample iOS project: https://github.com/JesseCrocker/Mapbox-gl-native-testcases/tree/vector-overzoom
Here's a gif showing the sample project, and a graph of memory use.
I am a Mapbox enterprise customer.
The text was updated successfully, but these errors were encountered: