2

Our app has the ability to chain navigation together, which is resulting in us running out of memory.

By chaining I mean we have one Activity, and a certain type of Fragment that allows you to open an instance of the same fragment type but with diff data.

e.g. Activity->MyFragment->MyFragment->MyFragment->MyFragment->MyFragment....

because of this we run out of memory eventually as this fragment has a viewpager of images plus another few images in it.

looking at the following two SO links

Android app out of memory issues - tried everything and still at a loss

When a Fragment is replaced and put in the back stack (or removed) does it stay in memory?

Diane (hackbod) highlights that you should tidy up your resources in onDestroyView, which I have done.

However, using the Memory tab in Android Monitor, and dumping the heap to hprof files, I can see that my bitmaps and imageviews never get destroyed.

I am wondering if this is something to do with Glide and the bitmapPool? I don't know how to configure this as we are only using the static Gilde.with method to get a RequestManager and I can't see any methods in that to configure bitmapPools or anything.

Any ideas?

:)

Community
  • 1
  • 1
Russ Wheeler
  • 2,590
  • 5
  • 30
  • 57

0 Answers0