Android - Can Application Context Solve Memory Leaks?

850 Views Asked by At

Using the longest-lived context instead of Activity context should be a good practice to avoid memory leaks when configuration (screen orientation, default language) change. However, I think these objects which reference to Application context still consume an amount of the Heap memory. So when they are released? If they are released when the process is ended, are they considered as a type of memory leaks?

1

There are 1 best solutions below

0
On BEST ANSWER

The application context will not be released until the application is destroyed, regardless of whether you hold on to a reference to it or not.