Page 1 of 2
What does the dalvik cache do?

Posted:
January 19th, 2011, 9:14 am
by glostermeteor
I have performed an update to my Build.Prop file as per the method described in the forum.
I would like to know what does the dalvik cache do? It says this has been increased.
Glostermeteor
Re: What does the dalvik cache do?

Posted:
January 19th, 2011, 10:25 am
by Fonefixer
I believe its similar to the prefetch folder in windows. It stores files for quicker future access.
Someone may have a better answer though..
Re: What does the dalvik cache do?

Posted:
January 19th, 2011, 10:40 am
by Warpedflash
Simple explanation:
When Android starts up, the DalvikVM looks thru all of your applications (.apk files) and frameworks, and builds a tree of dependencies. It uses this dependency tree to optimize the bytecode for every application and stores it in the Dalvik cache. The applications are then run using the optimized bytecode. This is why when you install a new ROM, sometimes it takes a very long time to boot for the first time. Any time an application (or framework library) changes, it's reoptimized and the cache is updated.
stolen from here:
http://forum.xda-developers.com/showthread.php?t=519495
Re: What does the dalvik cache do?

Posted:
January 19th, 2011, 7:07 pm
by krulimiteer
How have you increased the Dalvik cache, doesnt it just increase incrementally as needed. If you have set it to have a specific max size have you moved it onto a seperate partition?
Re: What does the dalvik cache do?

Posted:
January 19th, 2011, 7:09 pm
by Diego
Most things of this nature have a limit and dump older data on need.
Re: What does the dalvik cache do?

Posted:
January 19th, 2011, 7:24 pm
by krulimiteer
Okay, but why increase it to that much manually, just let it do its job, by forcing it to have a specific size doesnt it just fill with useless data from old apps and back to square one, most dont like it taking up app storage space so have moved it to sd storage
Re: What does the dalvik cache do?

Posted:
January 19th, 2011, 9:57 pm
by Warpedflash
no it does not expand automatically. having a higher size means that more stuff will open faster.
also it uses ram... not nand space
Re: What does the dalvik cache do?

Posted:
January 20th, 2011, 1:28 am
by krulimiteer
I wasnt meaning any memory mapped bytecode used by the dalvik vm, but the actual Dalvik cache where apk dex files are stored, and yes indeed it is usual stored on nand space, and yes it does expand with the amount of apps you have installed. Explained here from the Cyanogen forum:
"Dalvik-cache lives on the /data partition, and is the cache for the Dalvik virtual machine (it basically optimizes your programs to run on your phone, and stores the optimized versions.) Also, nothing bad will ever happen if you wipe your dalvik-cache. It WILL make your phone take longer to boot the first time after you clear it (since it has to re-build it), but it doesn't break anything. If you've uninstalled an app, and haven't wiped your dalvik-cache, that app's .dex file is still on your phone, slowing it down (probably imperceptibly, but still

)"
Post #1097 by SeidoJohn
http://forum.cyanogenmod.com/topic/2...page__st__1080references:
http://imsciences.edu.pk/serg/wp-conten ... vik-VM.pdfhttp://www.netmite.com/android/mydroid/ ... exopt.html
Re: What does the dalvik cache do?

Posted:
January 20th, 2011, 8:46 am
by Warpedflash
huh more you know eh.
you can always reduce it if you want to? It give a boost in system performance thas why it was done. go change it if you want to? change it back to 24 if you think thats what it should be.
Also i saved v3 of my build.prop without unix line endings so you get a nice square if you view it/change it with root explorer.
Re: What does the dalvik cache do?

Posted:
January 20th, 2011, 9:21 am
by krulimiteer
Yes sorry I think we got our wires crossed, you were, or are talking about dalvik max heapsize that you have increased in the build.prop, whereas I was refering to dex files stored in dalvik cache. I have increased heapsize to 40 as that seems to be the optimal value, and as you say 24 is low and people have had problems with adobe runnuing out of memory at that setting, but I have not found increasing over 40 to have any benefits, possibly the opposite. Interesting thread on this here:
http://osdir.com/ml/android-platform/20 ... 00177.html