Recently, I rooted my phone (Samsung Galaxy On7, Android 6.0.1) using Magisk systemless root using TWRP. After the flashing was over, I also cleared the Dalvik cache, not knowing that this was not necessary. When I rebooted the phone, it took a long time to boot. It was showing, "Optimizing apps". I thought I had cracked the phone up and it was a boot loop. But later I found that everything was fine. In addition, clearing of the Dalvik cache actually freed up the internal memory by about 1GB.

I read on Stack Overflow that Dalvik cache is actually the optimized dex files that the dex compiler builds to ensure the smooth running of applications. Now, the last official update to this phone was back in April 2018. Is it possible that the phone retained the cache of all apps since then, including the ones I had uninstalled? It seems so, otherwise how could I recover about 1GB of memory simply by clearing the Dalvik cache?

If I am correct that clearing the Dalvik cache freed up space, does it make sense to clear the Dalvik cache periodically, say annually, so as to prevent misuse of the "precious" internal memory?

1 Answer 1


If you have the habit of removing apps on a regular basis, then you can clear it regularly. Once a year or once every 6 months should be fine. If you have root, then you can use Titanium backup as stated on this answer to remove dex files not link to apps.

  • 1
    Starting with L or M, /data/dalvik-cache/ is only used for system apps, not for user apps. User apps' ART cache is located in /data/app/<PKG>/oat/ which should be deleted with app uninstallation. That's what my understanding is. Commented Aug 9, 2019 at 19:06
  • 1
    @IrfanLatif Android L Commented Aug 9, 2019 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .