I have TabHost with 12 tabs and I need to be able to access them all. However, as I press tabs memory usage increases until after 9th opened tab it simply freezes. Is there any way to release memory taken by TabHost if tabs are not visible to user?
Asked
Active
Viewed 357 times
1
-
Unfortunately the TabHost is deprecated. I'm using a SectionsPagerAdapter in my ViewPager, then Android will take care of your memory. – Tobias S Aug 04 '15 at 06:45
-
@Tobias K. Well I tried ViewPager instead of TabHost but it also freezes due to reached the memory limit. – Alex Bailo Aug 04 '15 at 07:07
-
Normally the current view as well as it neighbours are cached, not more and not less. I think, your code is messy :( – Tobias S Aug 04 '15 at 13:15
1 Answers
2
You have to read about memory in Android. Maybe TabHost/ViewPager is not a problem.
Read here or here about memory leak detection. Then you will be able to see which thing takes your RAM and not release. Next, You can make audit of your code (optimize, refactoring and debug).

Community
- 1
- 1

Eliasz Kubala
- 3,836
- 1
- 23
- 28