osmandapp / OsmAnd

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

Out of memory crash while calculating average distance route #14910

Open sergii-kavun opened 2 years ago

sergii-kavun commented 2 years ago

Description

Osmand app crashes complete while application tries to build a route within average distance 70km-150km cycling route. Once route calculation is started in Cycle profile, route is being calculated for more than 2-5 mins and then application crashes without throwing any exception or message to user.

I have tried on 2 mobile devices and Win Android emulator, issue happens on all devices with the same route. Issue doesn`t depend on OpenGL usage, it happens in either cases.

Profile: Cycle Style of map: OsmAnd Details:

Routing preferences:

Navigation mod:

How to reproduce?

Start point: 51.06107 N, 17.00630 E End point: 50.76547 N, 15.75530 E Profile: Cycle Just start building the route and wait for crash

Your Environment

OsmAnd Version: 4.2.7 (Google Play) Android/iOS version: Android 11 Device model: Xiaomi Mi9SE- MIUI Global 12.5.1

Maps used (online or offline):
Offline Local vector maps Poland - 1 July 2022 Poland Dolnośląskie - 1 July 2022 exception.log logcat.log

https://user-images.githubusercontent.com/26096800/180438487-893a8308-9ac7-461e-b33b-edfd3be3d446.mp4

sergii-kavun commented 2 years ago

Video from Win Android emulator added as reference. The same happens on 3 mobile devices.

TheSnoozer commented 2 years ago

Could you perhaps check if there is any crash report or logcat report?

E.g. In the main menu (very left corner next to the navigation logo) -> Help -> Send crash protocol / send logcat protocol

sergii-kavun commented 2 years ago

Hi, exception and logcat from one of the phone is attached to thread directly after app crashed.

vshcherb commented 2 years ago

As I see it fails with java.lang.OutOfMemoryError. It's quite a long route for cycle as we have non-optimized routing for cyclists actually. The route is 120 km.

vshcherb commented 2 years ago

Some dev details: Segments to visit 600 000, calculation time 40 seconds Screen Shot 2022-07-25 at 18 40 01

sergii-kavun commented 2 years ago

Hi, It`s quite unclear whether crash issue will be fixed by optimizing cycle routing or we should stop using that function at all ? Thanks.

vshcherb commented 2 years ago

Not clear indeed, did you try increasing memory Development plugin - settings ? If memory won't be enough then we simpply can't use that function for now that's it. I consider tha t we need to limit to 1000000 segments on top devices. On the other hand we need to optimize but thats needs to be implemented first.