mapbox / mapbox/mapbox-navigation-android
Main thread lag and skipped frames when mapboxNavigation.startTripSession() called
Nessuno ha ancora preso questa issue.
- Lingua principale
- Kotlin
- Stelle
- 651
- Fork
- 321
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
This issue occurs in our code, Ive provided a stripped down version of this issue on the following github link.
Android API: 21
Mapbox Navigation SDK version: 1.4.0
Code: https://github.com/JustinmClapperton/mapboxAndroidTest
Example: https://youtu.be/t0DjKnAMDN8
(You will need to add your own Mapbox API key to gradle.properties and strings.xml)
video:
Steps to trigger behavior
- Run the app
- Try to drag the map around and watch for skips
Expected behavior
App performs smoothly with no lag on the main thread. LocationEngineRequest Params should be respected
Actual behavior
App performs incredibly slow with several skipped frames on the main thread. No matter what I set the following code snippet too updates still happen less than every second, this could likely be part of the lag I'm experiencing.
LocationEngineRequest request = new LocationEngineRequest.Builder(10000L)
.setFastestInterval(5000L)
.setDisplacement(1)
.setPriority(LocationEngineRequest.PRIORITY_HIGH_ACCURACY)
.build();
Logs
I/pboxandroidtes: Background concurrent copying GC freed 259824(6913KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7027KB/12MB, paused 301us total 146.792ms
I/Choreographer: Skipped 48 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 256244(6982KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7006KB/12MB, paused 322us total 135.444ms
I/Choreographer: Skipped 45 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 259217(6978KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7196KB/13MB, paused 333us total 160.829ms
I/Choreographer: Skipped 47 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 271095(7222KB) AllocSpace objects, 0(0B) LOS objects, 45% free, 7318KB/13MB, paused 1.486ms total 163.121ms
I/pboxandroidtes: Background concurrent copying GC freed 269248(7251KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7011KB/12MB, paused 237us total 135.379ms
I/Choreographer: Skipped 45 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 259356(6983KB) AllocSpace objects, 0(0B) LOS objects, 47% free, 6891KB/12MB, paused 305us total 151.584ms
I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 258053(6855KB) AllocSpace objects, 0(0B) LOS objects, 45% free, 7301KB/13MB, paused 481us total 165.290ms
I/pboxandroidtes: Background concurrent copying GC freed 270151(7256KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7004KB/12MB, paused 398us total 141.638ms
I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 259398(6968KB) AllocSpace objects, 0(0B) LOS objects, 47% free, 6900KB/12MB, paused 320us total 156.619ms
I/pboxandroidtes: Background concurrent copying GC freed 257282(6864KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7028KB/12MB, paused 381us total 139.903ms
I/Choreographer: Skipped 47 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 256008(6948KB) AllocSpace objects, 0(0B) LOS objects, 47% free, 6864KB/12MB, paused 2.410ms total 141.356ms
I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 252915(6819KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7005KB/12MB, paused 422us total 135.958ms
I/Choreographer: Skipped 45 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 265328(7078KB) AllocSpace objects, 0(0B) LOS objects, 45% free, 7383KB/13MB, paused 526us total 190.145ms
I/pboxandroidtes: Background concurrent copying GC freed 272371(7317KB) AllocSpace objects, 0(0B) LOS objects, 46% free, 7105KB/12MB, paused 332us total 143.023ms
I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
I/pboxandroidtes: Background concurrent copying GC freed 263058(7078KB) AllocSpace objects, 0(0B) LOS o```
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la riproduzione mapboxAndroidTest collegata e aggiungi la API key richiesta in gradle.properties e strings.xml. Esegui l’app su Android API 21, chiama startTripSession(), trascina la mappa e confronta i log dei frame saltati con le impostazioni di LocationEngineRequest. L’attività è completata quando la mappa rimane reattiva e i parametri di aggiornamento della posizione richiesti vengono rispettati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, java
- Ambito
- mobile, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100