I’ve been flashing CyanogenMod 9 nightlies for months now, and the process to do so has become pretty much muscle memory at this point (if cwm ever changes its menu order I’m screwed). One step of this process has always fascinated me simply because I have no idea what exactly it does and why I have to do it: clearing Dalvik cache.
The process of upgrading CyanogenMod 9 nightlies for the Samsung Galaxy SII is pretty elementary, and basically, anyone can do it (hence even I never had it fail).
- Download latest nightly
- Transfer to device
- Reboot into cwm
- Install the nightly zip file
- Clear cache
- Clear Dalvik cache
This whole process takes only a few minutes, so I usually do it a few times a week. Now that CM9 has become a bit more mature, the improvements between each nightly have gotten smaller, so there’s no need to keep up with every single one of them anymore.
So, it’s step 6 that has me wondering. What exactly is happening when the Dalvik cache is cleared? Obviously, cached data is being removed, but what is in this cache? What is its function? Regular application data isn’t part of that particular cache, so I’m guessing it’s way more low-level than that. I have little to no knowledge on Java either, so I don’t really know what kind of cache a Java VM needs in order to function, and why it must be emptied when you move to a new nightly.
Searching the web reveals several forum posts on the issue, but nothing conclusive or truly informative – it usually devolves into a discussion about whether or not it’s even necessary in the first place. Do any OSNews readers have the answers to these questions in a more definitive sense?