Memory Leak on Page Navigation on NS7
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- ios, javascript
- Domaine
- mobile-dev, performance
Piste de recherche
Commencez par reproduire la fuite avec les projets d’exemple NS7 et NS6 liés, puis profilez la navigation répétée entre les pages sur iOS et comparez le comportement avec Android. L’issue est terminée lorsque la source de la mémoire retenue est identifiée et que la navigation n’entraîne plus l’augmentation de mémoire signalée ni le gel qui finit par se produire.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Environment
"@nativescript/core": "7.3.0"
"nativescript-vue": "^2.8.1"
"@nativescript/ios": "7.2.0"
✔ Component nativescript has 7.2.1 version and is up to date.
✔ Component @nativescript/core has 7.3.0 version and is up to date.
✔ Component @nativescript/ios has 7.2.0 version and is up to date.
Describe the bug
NS is not freeing memory on page navigations on iOS. When profiling, on each page navigation, the memory increases and app gets slower until, at some point, the app freezes or the OS terminates the app. This behaviour is restricted to IOS, we have profiled with the Android Runtime (https://github.com/NativeScript/android-runtime) and the garbage collection works as expected.
On a very simple application, two included below, each page navigation increases the memory footprint of the app by 60 - 80 megs until the app reaches 1 - 2 Gigs and stops working. If we have a complex page, with some images, and scroll on a list then the memory increases in small iterations but once we navigate to a new page, the memory jumps by 60 - 80 megs.
We have created several test apps with Vue and Angular and the memory leak occurs irrespective of the JS framework.
Solutions Tried and Reviewed
-
The same issues has been posted previously - Memory Leak on 7.2.0 with (https://github.com/NativeScript/ns-v8ios-runtime)
https://github.com/NativeScript/ns-v8ios-runtime/issues/105We have also:
EnableProdMode: Is there something similar to enable prod mode on Vue
https://github.com/NativeScript/nativescript-angular/issues/1215
Markingmode: https://nativescript.org/blog/markingmode-none-is-official-boost-android-performance-while-avoiding-memory-issues/ -
Downgraded Nativescript iOSCore to 6.5.4 (https://github.com/NativeScript/ios-runtime).
We experience the same issues with the older runtime.
-
Manually destroyed the component - tried different call backs (Unloaded for example)
https://github.com/nstudio/nativescript-videoplayer/issues/129 -
Tried with Angular (its happening even on the creation project templates)
-
Tried with the templates project with 6.5.4
-
Set the V8flags in the config for IOS (on the V8 Runtime https://github.com/NativeScript/ns-v8ios-runtime)
-
Navigating with the clearHistory flag (set to true) and navigateBack method = same result
-
Tested on simulators and real iPhones. (iOS 12.4.8, iOS 13.1, 13.3.1)
-
Tested with different Layouts (complex and simple)
-
Manually calling the GC in the navigate back method reduces the memory by a small percentage (0.1% - 0.3%).
-
As mentioned, it works on Android, see the profiling from below.

Project Examples
We include two sample projects, the first is NS7 and the second NS6, both exhibit the same issues with memory.
NS7: https://github.com/alkimiiapps/memoryleakexample
NS6: https://github.com/alkimiiapps/ns6test
Example Video of the memory reaching 0.5 Gig
Here is a gif of the profiling, where the user navigates back and forth between pages and the memory increases with each navigation.
- Langage dominant
- JavaScript
- Étoiles
- 150
- Forks
- 44
- Merge moyen
- 1 j 1 h
- PR mergées (30 j)
- 10
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de NativeScript/ios
-
isImplementedInClass leaks the losing sample instance on re-entrant or racing cache populationOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
NativeScript/ios#459 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
worker.terminate() is a no-op during entry evaluation, and terminating there wedges teardownOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
NativeScript/ios#445 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 3-5 jours Accessibilité débutants 66/100
NativeScript/ios#414 ·
Les mainteneurs répondent en général sous 1 jour
-
question
Difficulté 4/5 3-5 jours Accessibilité débutants 34/100
NativeScript/ios#364 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
NativeScript/ios#355 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de NativeScript/ios
Issues similaires
-
Difficulté 2/5 Moins d'une heure Accessibilité débutants 88/100
invoiceninja/invoiceninja#13320 ·
Les mainteneurs répondent en général sous 1 jour
-
Type:Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
NuGet/NuGetGallery#11026 ·
Les mainteneurs répondent en général sous 1 jour
-
NoCode.vue, Task.vue: replace explicit `any` with real typesPeut-être pris @prayas-bit l’a pris aujourd’hui. Ouvertearea/frontend good first issue kind/cooldown
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
kestra-io/kestra#20347 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Electron/Chromium StatusNotifierItem unreachable via unique bus name, tray icon never appearsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
ubuntu/gnome-shell-extension-appindicator#676 · 1 commentaire ·
-
first-Agent inherits Docker TLS settings for its recorded Unix socketPeut-être pris @ericcaiwx-star l’a pris aujourd’hui. Ouverteclawsweeper:bulk-filed clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
openclaw/openclaw-enterprise#1337 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
