mapbox / mapbox/mapbox-navigation-android

Low memory conditions not handled.

Open
#2,065 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

**Android API:**
**Mapbox Navigation SDK version:**
MapboxNavigation.onDestroy() is not called during low memory conditions. As a result, resources are not released and, if navigation is in progress, it is not terminated. This causes indeterministic behavior of the app.

The root cause is that the Android OS does not guaranty a call to onDestroy() during low memory conditions. When the app is backgrounded, onDestroy() is not called, but onCreate() is called when the app is foregrounded. The SDK expects onDestroy()/onCreate() calls to be paired.

### Steps to trigger behavior

1. Using the emulator create a device with low initial memory
2. Start the Android demo App, or any other app that uses the SDK in that emulator
3. Start navigation and background/foreground the app.

### Expected behavior
The navigation session should continue

### Actual behavior
The App will either crash, display a black screen or enter some other indeterminate state.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the low-memory emulator scenario with the Android demo app and reviewing the MapboxNavigation.onDestroy()/onCreate() lifecycle handling described in the issue. Confirm how backgrounding affects an active navigation session; done means the session continues without a crash, black screen, or indeterminate state and resources are handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.