Hi all,
(If this mail layout with embedded table does not function in your mail client you can also read the attached pdf)
OsmAnd is a memory hungry program when it comes to route calculation to enable your navigation, and also for displaying the generated route.
About a week ago I wanted to calculate a longer route with OsmAnd and experienced constant crashes. Asking about this in a post turned out that the max distance was about 800 kilometers and I thought this was just a limit of Osmand (bummer!). A few days later I concluded that this had to be not OsmAnd itself but the limit on the amount of memory Osmand was allowed to use.
Having created many custom roms for many Archos based tablets until a year ago I decided to start playing with the heap memory on my phone.
Most phones and tablets still come with the heapsize memory parameter set to 32m, e.g. dalvik.vm.heapsize=32m (32m is 32 MegaByte). The heap size is set in the build.prop file of your phone/tablet (mine was also set to 32m).
The heapsize determines the total amount of memory a program can use. Memory use by OsmAnd is determined by three factors or a combination of these three factors.
Information density in a certain region (=information density in that map)
Complexity of the calculated route
Length of the calculated route
As said: the heapsize is very often still set to 32m, even for modern 512MB or 1024MB tablets and phones. These phones and tablets perform better when the heapsize is set to a higher value. This heapsize value is a very discriminative factor when calculating routes in OsmAnd.
So I did a few tests with several heap sizes.
I experimented with 24m, 32m (my phone's default as well), 48m, 64m, 80m.
Starting point: My home address, Zwolle, the Netherlands.
|
Heapsize -> |
24m |
32m |
48m |
64m |
80m |
|
Siegen, Nordrhein-westfalen, DE (294 km) |
OK1 |
OK |
OK |
OK |
OK |
|
Paris, France (558 km) |
X |
OK |
OK |
OK |
OK |
|
Praha, Czech republic (809 km) |
X |
NOK |
OK |
OK |
OK |
|
Saint Malo, Bretagne, France (895 km) |
X |
NOK |
OK |
OK |
OK |
|
Brest, Bretagne, France (1113 km) |
X |
X |
OK |
OK |
OK |
|
Bilbao, Spain (1470 km) |
X |
X |
X |
OK |
OK |
|
Malaga, Andalusia, Spain (2354 km) |
X |
X |
X |
X |
X2 |
OK: gets calculated and displayed and OsmAnd continues to function fine.
1: Keeps functioning but mentions that it doesn't have enough memory to display all screen elements.
NOK (not OK): Sometimes the route gets calculated and displayed but every next action (keypress) will crash OsmAnd.
Most of the time the app crashes during the calculation or at the end of the calculation.
X: OsmAnd crashes during the calculation.
2: Immediately after starting the calculation the error “Empty result”. This is obviously out of limits for OsmAnd and/or android. Most probably due to the 64m memory limit itself unless “android:largeHeap="true"” is used (I'm not a programmer, I can't elaborate on this).
Note that a value of 48m or 64m for the heapsize is quite acceptable on a 512MB or a 1024MB. A value of 80m or higher should definitely be avoided!
I will write a wiki article about this and I will elaborate a little more on adjusting the “ dalvik.vm.heapsize” in the build.prop in the wiki article. Depending on your phone and used file system (in the phone) this ranges from a piece of cake to almost undoable.
Harry
Harry
--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks for investigation, very interesting report indeed! But it is good to mention what is RAM as well, because navigation is done in C++ (native), so it should not be limited by heapsize. Also if you have timings it would be also great!
I will try to memorize this report because it is very valuable. Actually the trips are different by nature,for example there is a very difficult route for calculation Munchen -> Linz (Vienna), even though it is about 200-400 km.
--
I mean only *calculation*. You also could refer how much memory is used in General Settings (enable Development plugin).If you managed to calculate the complex route, you can switch to aLogcat program and check some interesting info. How much tiles were used (memory), how many times were tiles loaded/unloaded and how many segments were visited (it also gives precise information about timing loading data from file vs calculation time).I could explain it if it is interesting or unclear.Victor