Should the Dalvik cache on Android phones be cleared periodically?

  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
  • Tags Tags
    Android Root
Click For Summary

Discussion Overview

The discussion revolves around the implications of clearing the Dalvik cache on Android phones, particularly in the context of rooting devices and managing internal storage. Participants share personal experiences related to rooting, the effects of clearing the Dalvik cache, and the potential benefits of doing so periodically.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their experience rooting a Samsung Galaxy On7 and clearing the Dalvik cache, noting a significant recovery of internal memory.
  • Another participant questions whether the effort to remove bloatware was worth the trouble involved in rooting the device.
  • A participant mentions that their phone was slow and that rooting allowed them to remove system apps, which they believe improved performance.
  • Concerns are raised about the risks of bricking the phone during the rooting process, highlighting the anxiety associated with such modifications.
  • Updates are provided by the original poster about encountering a bootloop after rooting and successfully restoring the phone using the stock ROM.
  • General advice is shared about the importance of making backups before performing significant changes to the device.
  • One participant reflects on the data they lost during the process and emphasizes the need to back up the stock ROM for future safety.

Areas of Agreement / Disagreement

Participants express a mix of experiences and opinions regarding the value of rooting and clearing the Dalvik cache. There is no consensus on whether clearing the Dalvik cache should be done periodically, as some participants focus on personal experiences rather than establishing a general rule.

Contextual Notes

Participants mention various assumptions about the performance of their devices and the impact of clearing the Dalvik cache, but these are not universally agreed upon. The discussion includes personal anecdotes that may not apply to all Android devices or situations.

Who May Find This Useful

Individuals interested in Android device customization, rooting, and memory management may find this discussion relevant, particularly those considering rooting their devices or managing storage issues.

Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,186
Reaction score
2,694
Finally, after a lot of hesitation, I rooted my phone (Samsung Galaxy On7, Android 6.0.1) using Magisk systemless root. The main aim was to remove pre-installed useless software (often termed "bloatware").

I didn't want to flash Magisk using TWRP, because installing TWRP would remove the stock recovery, and I would never get it back. I tried rooting using the Magisk installer itself, but it failed. So I had to unwillingly install TWRP first (thereby losing the stock recovery). I tried doing that using ADB (actually fastboot), but it couldn't recognise the device in bootloader mode. So I downloaded Odin and flashed TWRP. Then I flashed the Magisk zip file.

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 online 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?
 
Computer science news on Phys.org
Wow! What a lot of work and trouble. I know that bloatware is annoying, but was it worth that much to get rid of it?
 
anorlunda said:
Wow! What a lot of work and trouble. I know that bloatware is annoying, but was it worth that much to get rid of it?
Actually, my phone was getting too slow to work with. I never had any games installed (except maybe when the phone was first bought, but that is a long time back). I specifically installed the apps which could be moved to SD card. Even then, every morning, I would see more and more of internal storage being used up. This became irritating. If I took the phone to a service centre, they would either do a factory reset or ask me to change the motherboard. The second one is quite costly.

I read online that if you root the phone, then you can remove these system apps easily. Although your reserved system space is still not available for user app installations, the phone still becomes a bit faster, at least people on StackOverflow commented so. (You can actually use the freed-up system reserved space if you want, using the Magisk module "App Systemizer". It converts user-installed apps to system apps, and those will stay even if you unroot your device). Basically, this was the motivation. In addition, I was always interested in stuff like these, so it was not much trouble, except that I was scared that I might brick the phone. Also, XDA Developers have published extensive guides to root a phone, and they are very helpful for beginners like me.
 
  • Like
Likes   Reactions: anorlunda
Update: The phone suddenly switched itself off, and is now in a bootloop.:cry::headbang:
 
Update #2: Amidst the tension of losing the phone, it came to my mind that if I can somehow get the stock ROM and flash it, the phone will come back. So I started searching the net frantically, and finally came across the stock ROM. Downloaded it (a 1GB file), flashed it with Odin (the phone was able to enter recovery and download mode).

And finally, I have my phone back! Phew!
 
General rule with computers:
Make a backup FIRST!
 
Tom.G said:
General rule with computers:
Make a backup FIRST!
I store all my data in SD Card, so I didn't lose any personal data. What I lost was a couple of screenshots in the phone memory. My contacts are in Google account, so no fear losing them.

What I should have backed up was the stock ROM. The version of stock ROM that I found online was an old one, and I had to download all the OTA updates. As soon as all the updates were downloaded, I installed TWRP and backed up the system and app data. It is a ~5GB file, and I shall keep it safely for the future.
 
  • Like
Likes   Reactions: Tom.G

Similar threads

  • · Replies 16 ·
Replies
16
Views
8K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K