mardi 12 juillet 2016

Is GC guaranteed to free memory of unused activities

I am trying to analyze the memory usage of the Android app. I do that using

adb shell dumpsys meminfo <package name>

My app has only one Activity and I repeat the following steps probably a dozen of times:

  1. open the app;
  2. exit using the back button

After doing that a dozen of times dumpsys shows that around 1-2 instances of my Activities are still in memory. After I hit adb dumpsys for a couple of times the Activity count goes down to zero. Is this normal? If it is a leak I don't expect the Activity count to go down to zero. Does that mean GC claims the memory of the Activity objects slowly?

Aucun commentaire:

Enregistrer un commentaire