• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

about dalvik and cache

patrickdrd

Newbie
so what's about android's cache management system? last night another strange thing happened: I had around 570mb free internal storage space, I moved my apps from my sd card to the internal and there was 350mb left, after that I went into recovery and cleaned dalvik cache and cache, after booting free space went up to 530mb! and after some minutes even up to 570mb! so, my question is can somebody explain this behavior? is this normal? and which one of the two (dalvik or cache) frees up the space?

thanks in advance!
 
Short answer: neither frees space for long.

Cache is what the name implies: temporary files. Clearing that will create space, but then more data will start being cached again so it will start to refill. It can however be worth a try for a variety of other problems, in case they were caused by corrupt data in here.

The "dalvik cache" is different (in quotes because unless you have a very old phone the runtime environment is actually ART rather than Dalvik these days). These are actually parts of your apps, built during the app installation process. So if you clear the dalvik cache it will be rebuilt when you reboot the phone; if you saw a lot of "android is optimising" messages that was the dalvik cache being rebuilt . You may gain slightly if an uninstall was incomplete and something was left behind in there (since that would not be rebuilt), but that's all.
 
thanks, so, since I'm talking about freed space, let's focus on cache cleaning (from recovery), this should be faster too, because, yes I have to wait for around half an hour for optimization before boot when I do "dalvik cache"

my speculation is, is this cache (the recovery one) different from the cache we get to clean from inside the android environment?
because I clean the latter often, I didn't get to witness such results, where was that (much) space occupied?
 
Yes, this is the system cache, so not the same as just clearing the cache for your apps (which has become a "one app at a time" operation on more recent Android versions).

Of course if you clear cache often you also won't see the same gains, because you aren't letting the cache build up very large in the first place ;)
 
so system cache can only be cleared from recovery?

also, I was running cm11 and stock kitkat before upgrading to (stock) lollipop 5.1, has the cache management changed?
because I hadn't noticed so large fluctuations before (like 200mb blocked and in use by system),
actually I never went in recovery to clean any kind of cache in KK, do I have to do it know in 5.1 because something has changed in cache implementation or is there something not working as it should?
 
It get's tricky, but I'd say that your cache is being built correctly, even though it is using more memory to do it.

ART (Android Run Time) was introduced in KitKat, but it wasn't the default runtime compiler. Especially if you updated from an earlier version to 4.4, you would maintain the Dalvik compiler for your apps unless you specifically switched to ART. I'm not sure if flashing a stock 4.4 rom would use ART by default. Many upgrades were set up NOT to switch your runtime compiler even into 5.x but any stock rom or phone released with 5 or higher uses ART.

You can read up on the technical details of ART in the link above, but in general as Android advances, it's going to expect faster processors and more native memory so it will try and take advantage of that. There comes a point that an old phone simply won't support (or even run) with a later OS.
 
It happened again!
I connected it to the charger and went to sleep,
next morning free space fell from 400mb to 270mb!!
I wiped dalvik once again and now I got almost 440mb free space!
Can anyone tell me if this behavior is normal? I just cannot understand what is android doing with my cache/free space when there is no usage at all!
Is it the rom (stock, but optimized 5.1), this is so weird!
 
Back
Top Bottom