I have an Activity that contains a single Fragment and that Fragment has a ViewPager with a FragmentPagerAdapter that pages other Fragments:
--> ChildFragment
MyActivity -> HostFragment w ViewPager --> ChildFragment
--> ChildFragment
In the ChildFragment, I use the Android-Universal-Image-Loader library to display a couple of Images. On a Nexus S i run out of memory with the infamous
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
very fast, after about 10 Childfragments swiped (about 50-100 bitmaps). I tried settings all recommended settings to the UIL config, disabled chaching, to no avail. I also tried recycling all bitmaps of a Childfragment in onDestroyView, didn't help.
Could my setup with the nested fragments have to do with this problem? In another app I only have an Activity with a Viewpager and the Childfragments (without the middle fragment) and I don't have this problem.
I checked the Heap size in Eclipses DDMS view, how can the app crash when it still has 45% of its Heap size free? The heap view says:
Heap size 10 MB Allocated 5,4 MB Free 4,5 MB
How can the the app out of memory like that?