Navigate Memory Problem
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- ios, javascript
- Domínio
- mobile-dev, performance
Direção de pesquisa
Comece pelo repositório vinculado atabix/nativescript-memory-leak-example e reproduza seu loop de navegação para a mesma página a cada segundo durante 30 minutos com @nativescript/ios 6.5.4 e 7.2.0. Leia as issues referenciadas de NativeScript, nativescript-angular e ns-v8ios-runtime enquanto faz o profiling da memória; considera-se concluído quando o vazamento estiver isolado e o teste de navegação não mostrar mais o crescimento relatado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I am running into a reproducible memory leak that occurs when navigating to another page.
In my example we navigate with a 1 second timeout to the same page in an endless loop.
Example Repository:
https://github.com/atabix/nativescript-memory-leak-example
➜ nativescript -v
7.2.0
Use Case 1
Run the app with all of the same dependencies with one exception:
@nativescript/[email protected]
Allow the app to run for a period of thirty minutes.
Use Case 2
Run the app with all of the same dependencies with one exception:
@nativescript/[email protected]
Allow the app to run for a period of thirty minutes.
Results
The app starts around ~74MB in both uses cases. In this first couple of minutes the app slowly increases in total memory used, incrementing about 1MB every couple of seconds.
After this initial period the memory seems to stabilize at around 93MB.
The same test has been applied to two very different apps in production with pages that are more complex. This example here resulted in 1MB increments. The production apps resulted in 50MB increments (starting at 146MB and eventually reaching 2GB). In combination with navigating between different kinds of pages this memory problem is compounded, eventually resulting in the app shutting itself down.
This behavior remained consistent when manually calling Utils.GC() and using clearHistory: true on navigation. These two seemed to have no affect on the outcome of the results.
Honorable mention
The issue was first discovered in a project using nativescript-vue. The funny thing is that the amount of memory in each increment used is less than vanilla NativeScript. To remove nativescript-vue as a variable the above uses cases have taken place without it.
References
https://github.com/NativeScript/NativeScript/issues/6890
- Manual garbage collection doesn't resolve the issue.
https://github.com/NativeScript/nativescript-angular/issues/1215
- The issue seems to be with Angular. A similar approach was attempted for NativeScript Vue by hooking into the destroy method of Vue components; however, as mentioned above, Vue doesn't seem to be a factor in this problem.
https://github.com/NativeScript/ns-v8ios-runtime/issues/100
- This is currently an issue in the v7.2.0 iOS runtime. Perhaps it may also be affecting other factors of NativeScript?
I am currently at a loss as to how to proceed. The issue is extremely significant in any pages that display more than a single button and some text. It's only apparent in apps where people navigate between pages a lot for an extended period of time.
- Linguagem predominante
- JavaScript
- Estrelas
- 150
- Forks
- 44
- Merge médio
- 5d 12h
- PRs com merge (30d)
- 12
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NativeScript/ios
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 22/100
NativeScript/ios#503 ·
Mantenedores costumam responder em até 2 dias
-
isImplementedInClass leaks the losing sample instance on re-entrant or racing cache populationAberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
NativeScript/ios#459 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
worker.terminate() is a no-op during entry evaluation, and terminating there wedges teardownTalvez já em andamento @edusperoni assumiu há 2 dias. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
NativeScript/ios#445 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 3/5 3-5 dias Facilidade para iniciantes 66/100
NativeScript/ios#414 ·
Mantenedores costumam responder em até 2 dias
-
question
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 34/100
NativeScript/ios#364 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
Todas as issues de NativeScript/ios
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
yjh051108/dsh-routing-suite#216 ·
-
bug user-priority/P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
t8y2/dbx#11718 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 4 dias
-
bug confirmed perf
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
videojs/video.js#9400 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia