anasrp08 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 3 forks source link

App startup becomes slower when using osmdroid.jar #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use OSM maps for a while and file up the /sdcard/osmdroid/tiles dir
2. Stop the PID of the app using osmdroid 
3. Start the app and run trace to profile the method calls

What is the expected output? What do you see instead?
I expect the app to start quickly. I see a long black screen of blocked
 app.

What version of the product are you using? On what operating system?
osmdroid 1.10 in open gps tracker 0.9.24 on a stock froyo nexus one

Please provide any additional information below.

The call to File.listFiles() in 
OpenStreetMapTileFilesystemProvider.calculateDirectorySize() blocks the main 
thread a lot. 

http://code.google.com/p/osmdroid/source/browse/trunk/osmdroid-android/src/org/a
ndnav/osm/tileprovider/OpenStreetMapTileFilesystemProvider.java

The workaround is to delete /sdcard/osmdroid when things get to slow.

I've attached the traceview I took during a start will my app had a black 
blocking screen.

Original issue reported on code.google.com by rcgr...@gmail.com on 17 Jan 2011 at 8:50

Attachments:

GoogleCodeExporter commented 9 years ago
This refers to the deprecated org.andnav package - we really should fix issue 
137 soon to avoid all this confusion!

However, the same issue occurs in TileWriter - see the TODO in the constructor
http://code.google.com/p/osmdroid/source/browse/trunk/osmdroid-android/src/org/o
smdroid/tileprovider/modules/TileWriter.java

Original comment by neilboyd on 18 Jan 2011 at 6:11

GoogleCodeExporter commented 9 years ago
I made a change to TileWriter in revision 739 which should fix this.

Original comment by neilboyd on 18 Jan 2011 at 10:09

GoogleCodeExporter commented 9 years ago
I can confirm that app startup is much faster for me.

Original comment by kurtzm...@gmail.com on 21 Jan 2011 at 2:52

GoogleCodeExporter commented 9 years ago
I believe it's safe to close this ticket. There was a version of the TileWriter 
that checked the disk cache on the UI thread and that was causing slow start up 
times. This issue has been fixed and startup time is now normal.

Original comment by kurtzm...@gmail.com on 13 Feb 2011 at 7:05