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

What is dalvik-cache & why it's so important!? (Cyber Tips)

  • Thread starter Thread starter Deleted User
  • Start date Start date
D

Deleted User

Guest
Hello everyone welcome to this thread!

Today i will be talking to those Android Enthusists of why Dalvik-Cache is soo important for Android to even to run properly and to explain what dalvik-cache is....my goal is to share my experiences with development and passion for Android and this is one major step to get those newbies in on some information that can be used when developing for the first time!..let's get started shall we?

Okay What is Dalvik-Cache?

A: Dalvik-Cache is a unique form of Virtual RAM

Why do we need Dalvik-Cache & How is it used on Android?

A: Dalvik-Cache is important to android to run correctly, it is used across all android processes, apps, graphics, performance etc. Dalvik-Cache is a way where the CPU can access to load applications data quickly w/out the need of using physical ram to grab info to load up a next command a application requires, however their is some limitations with Dalvik-Cache since their is a limit to how much the CPU can access before it allocates and dumps the dalvik for the next processes needed for the next operation their are multiple of lines in build.prop that commands of how much dalvik is given to the cpu to use, this can be dangerous to alter but is worth it to modify if you know what your doing.

The dalvik-cache does have a storage limitation that does exceed a certain amout depending on how much physical ram your device has such as if your device has 1GB of ram the heapsize will be set to the max of 256m witch is half of 512MB of ram, this may not seem as much but it does effect if values are risen from their original values.

If you have 2GB of RAM your heapsize is set to 512m this is half of 1GB & so on

Their is a heapsizelimit that prevents the cpu to not store more then the given value, but uf it does exceed beyond the given value the cpu is given a command to dump dalvik for the next operation for what ever app & process your doing so any processes will not slow down.

Most devices has a limit between 64m-192m, however if your heapsize is 512m and you have 2GB of ram setting the heapsize limit to 256m you can give the CPU more space to work with and more processes to handle better & faster then previously before.

you are also given few other options such as how much Dalvik-Cache should start with with each new process before hitting the heapsize limit mark this line is called "heapsizestart" & it's default values are set at "8m", some custom roms has it set to "16m" for faster processing power but can also overheat your cpu overtime!


You even have values that are setup to save up certain amount of dalvik in case the cpu requires the space needed in case of an emergency these lines are set as follows:

"heapsizemin" & "heapsizemax" these values tell the cpu to keep a certain amount of dalvik free so dalvik doesnt over fill with data that is not needed and can be used for certrain process needed for the OS installed. The default values that are set are heapsizemin=2m & heapsizemax=8m. You can change these values but aren't recommended as these value may not effect the OS but can screw up a current opertation the cpu is doing at that moment in time!..


Why does everyone require us to Wipe Dalvik-Cache after installing a new rom or app?

A: the reason devs tell you to do this is because dalvik is a special storage space that only apps & the cpu can access, unlike with apps that can be unistalled while the system is running and wont have much effect until your restart your device, dalvik-cache is a partition that if a file is deleted whike the OS is in use this can casue errors and confuses the cpu and cause os to not boot and go wildly nuts as you can see the CPU is the only one who can delete files from Dalvik without any interaction from the user, the user can Wipe Dalvik Cache using either a Custom Recovery or via adb witch is the harder method and once done apps will have to be re optimized to work properly again the best thing about this is that it clears out anykind of corrupted data and harmful data that the cpu couldn't delete on it's own.

Dalvik is dangerous and before modfying it's values do it with care, and knowledge

If i made any errors in this thread please comment it below for others to see...Thanks for reading!
 
Last edited by a moderator:
That's great for older phones - but it's my understanding that newer versions of Android don't use Dalvik cache: rather, they use Android Run Time (ART). The difference is that ART loads all the app data at installation, one time, so the app doesn't have to access Dalvik every time it's run. Things move much faster that way.
 
"Congratulations" Its a very well written article and constructed as clear as the rain from heaven for any Android buff to understand. Very much appreciative and informative information. That article is especially essential for people that likes rooting their devices and want to add custom roms to their devices.
 
Last edited:
Back
Top Bottom