Memory leaks in demo and NbMenuItemComponent
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.1k
- Forks
- 1.5k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Issue type
**I'm submitting a ...** (check one with "x")
* [x] bug report
* [ ] feature request
### Issue description
I'm using ngx-admin for a several 'companies' with their data and have a button to switch companies.
I was researching memory leaks in my project using chrome DevTools Memory tab and found out that count of NbMenuItemComponent grows when switch between companies.
Once i found out that ComponentFactory up from 247 to near thousand. Can't reproduce such behavior now but since it is used in NbSpinnerDirective so you can visit spinner page and additional factory components will be loaded but not destroyed after returning to the home page.
By the way, original demo http://akveo.com/ngx-admin/pages/iot-dashboard has some leaks too:
snapshot size grows in dozens just by switching between two menu items. So, I guess the leak is not in NbMenuItemComponent or ComponentFactory only but in some other components.
**Current behavior:**
After 10 times switching on demo page ( between e-commerce and iot-dashboard ) snapshot size increase from 32.9MB to 70MB.
In my project after 3 times switching between companies( every time admin page is loaded ) NbMenuItemComponent grows 3 times.
After visiting spinner page ComponentFactory components grow and after returning to the home page don't utilize too.
**Expected behavior:**
Returning to initial state must be utilized all unused components, subscriptions e.t.c.
**Steps to reproduce:**
Switching between two tabs ( e-commerce - dashboard ) or visiting spinner page.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.