osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.66k stars 1.02k forks source link

Osmand gets really slow and crashes at max zoom level #20305

Closed Guylby closed 3 months ago

Guylby commented 3 months ago

Description

Hi,

I was zooming in on the map to place a favorite and I noticed a huge slowdown to map rendering. After a few seconds Osmand crashed. I retried the same thing and the crash happened a few times more (but nothing got dumped to the exception.log file).

I notice that this only happens at the max zoom levels, here is a video demonstrating the behaviour:

First a few pans at various zoom levels, to show that the map loading is smooth and near instantaneous. Then when going to max level the map stops rendering and everything slows down. Only when zooming back that the map starts to load correctly again.

I opened the logcat file and it was filled with hundreds of the same messages:

07-12 22:29:34.720  4246  4246 D net.osmand: SQLiteTileSource Open /storage/emulated/0/Android/media/net.osmand.plus/tiles/Microsoft Earth.sqlitedb {main}
07-12 22:29:35.306  4246  4384 W net.osmand.core:native: More than 1 basemap available
07-12 22:29:38.599  4246  4274 W System  : A resource failed to call close. 
07-12 22:29:38.608  4246  4274 W SQLiteConnectionPool: A SQLiteConnection object for database '/storage/emulated/0/Android/media/net.osmand.plus/tiles/Microsoft Earth.sqlitedb' was leaked!  Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
07-12 22:29:38.608  4246  4274 W System  : A resource failed to call SQLiteConnection.close. 

The Microsoft Earth layer was not enabled or loaded on this profile. It was just the default Osmand rendering with a few favorites and markers. It's also configured to not load only between 7 and 19 zoom level.

It might be related to issue #19548 as the user states that it crashes at max zoom level for him too and had the same messages.

Steps to reproduce

Zoom to max level and pan the map. Notice the slowdown of the map and the map having trouble loading.

Actual result

Osmand sometimes crash, and gets really slow at max zoom level.

Expected result

Osmand behaves the same as with other zoom levels.

Your Environment (required)

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

OsmAnd Version: 4.8.1
Android/iOS version: Android 13
Device model: Sony Xperia 10 III
Crash-Logs: ?
yuriiurshuliak commented 3 months ago

The bug was not reproduced. To test this, I went to the coordinates 45.7979995489437, 6.324999236091582 and downloaded the map, Contour lines, and Terrain map. Then zoomed in to the maximum level, panned, and quickly scrolled through the map. As a result, I did not experience any slowdown or crashes in the app.

OsmAnd~ 4.8.0#2738m, released: 2024-07-15

https://github.com/user-attachments/assets/7ef64121-fd44-42bc-8ef0-f6e4507fe7fa

DmitryAlexei commented 3 months ago

@Guylby please provide your browse map profile (menu > settings > browse map profile > export profile ) also add .txt extension to the file To speed up map rendering you can also try to delete one of the available basemaps: go to menu > maps and resources > local > standard maps > and delete one of the world overview maps

Guylby commented 3 months ago

@DmitryAlexei Hi, here is the default profile Browse Map: Browse map.osf.txt

I've done a clean install of Osmand 4.8.1 and reset the Browse map profile to default (then just reimported the quick action and customs buttons) and found a few things:

DmitryAlexei commented 3 months ago

As I see on the video, the slowdown is not so critical and only present at the close zoom levels. It may be caused by the overlapping maps of a region and a province. Or simply by the 3D maps: terrain data must be processed once and thereafter, it works fine.

At least on my device using provided coordinates with only one map of Var region (Provence-Alpes-Cote d'Azur) everything works as expected.

vshcherb commented 3 months ago

Reinstall helps probably related to live updates issue in the past