osmandapp / OsmAnd

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

Opening Maps & Resources / Local takes very long #20974

Open scaidermern opened 1 day ago

scaidermern commented 1 day ago

Description

Opening the "Local" tab at Maps & Resources takes very long (about 40 seconds). This happens both right after starting the app and also when coming back again later. It doesn't happen after loading finished and switching between the tabs Downloads and Local.

I tried to move all my maps, geotiff, heightmap and tracks to a different location so that OsmAnd doesn't have to index them. The behavior stays the same.

I already cleared OsmAnd's cache. The behavior stays the same.

Map panning/zooming speed is normal (within OsmAnd's abilities, at least :)).

Not sure if this is a new behavior with OsmAnd 4.9.0 since I had to replace my old phone and there is no easy way to switch back to the old, stable version.

I can provide a video but I don't think it will be of much use.

Steps to reproduce

Open Maps & Resources / Local.

Actual result

A loading icon appears for about 40 seconds.

Expected result

The content is shown almost immediately.

Your Environment (required)

OsmAnd Version: 4.9.0
Android version: 13
Device model: Fairphone 4
scaidermern commented 1 day ago

I can't reproduce this behavior with the current nightly. Was there any fix for this problem?

I'm not sure if reproducing it with the nightly really tells me if this problem got fixed since it has a different storage path etc.

scaidermern commented 1 day ago

I think I've found the reason. I had various online tiles downloaded. Indexing them seems to take ages. After removing everything in the tiles directory (which took quite a while) the content of the "Local" tab is now displayed after a few seconds.

The OsmAnd storage directory is located on my external SD card (External 2 aka /storage/asdf/Android/data/...). Could be a problem of newer Android versions? :(

Is there a reason why online tiles are stored as individual files? Maybe there will be a speed improvement when switching to a SQLite db or something similar.

DmitryAlexei commented 23 hours ago

This information worth adding to documentation (Troubleshooting section or Maps and resources > local )

vshcherb commented 22 hours ago

It's more like a bug than documentation, was a sqlite big ?

scaidermern commented 21 hours ago

was a sqlite big ?

Which sqlite?

From the video I recorded "Maps sources" was 0.6 MB. However, I don't really believe that. I had tiles from various different online map sources (OsmAnd online, Microsoft Earth, ...) in various geographic regions. Must have been more than just 0.6 MB, also considering that removing the tiles directory took quite some time.

Rowin63 commented 21 hours ago

The "tiles" folder is growing with every use (XX-thousand files / hundreds of MB) and can not be cleared easily. It´s only possible by using a file commander, and then one never knows what to delete or not (it´s not possible to delete just the tiles/areas/countries not used/wanted anymore, like "by area").

vshcherb commented 21 hours ago

Tiles folder should not calculating at all if it's takes > 2-3 seconds and in background, so we need than kind of a link "Calculate size" as we did in Storage analyzer