osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.62k stars 1.01k forks source link

Default Osmand map rendering styles slows down and results in OOM in POI dense area #20882

Open Guylby opened 5 days ago

Guylby commented 5 days ago

Description

I've noticed that in high zoom levels (from 20 to 22), in certains areas the rendering becomes slow and the whole app freezes for a few seconds and feels really unresponsive:

https://github.com/user-attachments/assets/ec72fca5-d8b7-4f07-9445-2f1100bf40dd

Looking at the logcat there was a few OOM errors like this (about 10 from the video above):

09-21 11:37:40.865 12969 13094 I scudo : Scudo OOM: The process has exhausted 256M for size class 96.

In one case there was a few errors like shown below, but they were not present in all logcat files where the OOM errors happened (so maybe not related):

09-21 11:37:02.472 12969 12969 W System.err: poi_barrier_small_black_3 09-21 11:37:02.472 12969 12969 W System.err: poi_small_black_3 09-21 11:37:02.472 12969 12969 W System.err: poi_black_3 09-21 11:37:02.473 12969 12969 W System.err: poi_3 09-21 11:37:02.473 12969 12969 W System.err: poi_barrier_small_black_3 09-21 11:37:02.473 12969 12969 W System.err: poi_small_black_3 09-21 11:37:02.473 12969 12969 W System.err: poi_black_3 09-21 11:37:02.473 12969 12969 W System.err: poi_3 09-21 11:37:18.081 12969 12969 W System.err: poi_entrance_yes 09-21 11:37:18.081 12969 12969 W System.err: poi_yes

This does happen in the Touring style, but not in other profiles like LightRS or a custom hiking profile (that shows similar level of details)

Steps to reproduce

Select a profile with the default Osmand map rendering style, Go to 43.12154 5.93328 have the corresponding vector map downloaded Pan around the area and notice the rendering becoming slower and slower, sometimes freezing

Actual result

Rendering becomes really slow and makes the app unresponsive

Expected result

Performance is consistent

Your Environment (required)

WARNING Crash-Logs MAY contain information you deem sensitive. Review this CAREFULLY before posting your issue!

OsmAnd Version: 4.9.0
Android/iOS version: 13
Device model: Sony xperia 10 III
Crash-Logs: ?
yuriiurshuliak commented 3 days ago

The bug could not be reproduced. To test it, navigate to coordinates 43.12154, 5.93328, set the zoom level to 20-22, and try scrolling the map in this area.

As a result, I did not observe any slowdown in rendering, and the map scrolling worked smoothly without any issues.

OsmAnd~ 4.9.0#3266m, released: 2024-09-24

https://github.com/user-attachments/assets/0084977f-b881-4153-87b3-e1ba62f6e5e7

Guylby commented 2 days ago

Hmm this is very strange,

I've reinstalled Osmand 4.9.0 with a fresh install, gone back to 4.8.6 with a fresh install and the problem still occured.

What is strange is that it only happens in certains areas with the default Osmand profile (or any Osmand default derived profile like UniRS, Touring, etc). But with LightRS or the Hiking rendering profile from the Osmand-rendering.github this slowdown does not appear. I've modified this hiking profile so that it shows as much POIs and text as the default Osmand profile (by copypasting sections of the default osmand profile) and the slowdown did not appear.

I've tried only downloaded the smaller map data of the region, and the slowdown is a little bit better but still really noticeable.

This seems linked to the rendering profile that maybe gets stuck on rendering certain elements but I can't find more information

Guylby commented 1 day ago

Here is a screen record of the issue: I've created a custom rendering style based on the Hiking rendering that did not have the slowdown, copied all the , and rendering sections from the Osmand defaut profile (to have similar look and POI density) I did not touch the and sections (or only added 1 or 2 lines)

The video starts with the modded rendering style, showing instant loading and no slowdowns while looking nearly identical to the default Osmand profile, then I switch to the default Osmand profile and the slowdowns are starting instantly, then I switch back to the modded rendering and the map is smooth again:

https://github.com/user-attachments/assets/5eef8f46-d191-4ace-8a5a-06a2ab3824a1