-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Memory not deallocated after logging out #21010
Description
Parent issue: #20989
There're memory leaks happening that are preventing ViewControllers, Views, Services, and other entities from being released after logging out. Moreover, the allocations and memory usage keep on increasing with each login-logout iteration. The potential causes can be multiple.
Login-logout sequence is just one of the angles to observe memory issues. However, I found it easier to reproduce and scope down.
Note, there's a possibility some of the issues could be resolved with Some notification observers are not removed but by looking at the memory graph I suspect there're many more issues to fix.
Expected behavior
Unused classes should be deallocated after logging out
Actual behavior
Classes are not deallocated after logging out, memory leaking, memory footprint keeps increasing with every login-logout sequence
Steps to reproduce the behavior
- Open the fresh app
- Observe the Memory Graph, only login-related classes are allocated
- Login
- Logout
- Observe the Memory Graph: Tab Bar, Dashboard, and many other classes are still allocated
- Login again
- Observe the Memory Graph: notice even more allocations. For example multiple instances of
BlogDashboardViewController. Observe memory increasing