Site icon DataFlair

Working of Dalvik Virtual Machine in Android

FREE Online Courses: Your Passport to Excellence - Start Now

In this DataFlair Android article, we’ll read about Dalvik Virtual Machine(DVM). Android DDM was written by Dan Bornstein, and Dalvik is the name of a town in Iceland.

A Dalvik virtual machine enables Android applications to run in its own process with its own instance.

Virtual Machine

Firstly let us understand what a virtual machine is? It is basically a software implementation of a physical computer. This implementation works like a real physical computer. It even compiles and runs programs the same as a physical computer. It can be understood like an emulator. There are some issues with virtual machines too. One is that it is less efficient when compared to physical computers. Another issue is its performance, which is unstable when multiple virtual machines are working simultaneously on the same machine.

Even though Java Virtual machine has a high performance and provides great memory management, it is not optimized for low-powered devices. Dalvik VM is also a virtual machine that is highly optimized for mobile devices. Thus, it provides all the three things, that are memory management, high performance as well as battery life. It is strictly developed for Android mobile phones.

Role of the Dalvik Virtual Machine

The Role of the DVM in Android includes:

The Dex compiler helps convert the class file into .dex file, the following image shows how it flows:

Dalvik Virtual Machine vs Android Runtime:

Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!

Let us see comparison between Android DVM and Android Runtime:

Dalvik Virtual Machine Android Runtime
Dalvik  is slower in comparison to Android Runtime Android Runtime is faster than Dalvik Virtual Machine
Dalvik Virtual Mchine takes less time to boot, Booting is fast Android Runtime takes more time to boot, Booting is slow
The Cache builds up fast over time, reducing the reboot time The cache is built at first boot, increasing the reboot time
Dalvik Virtual Mchine needs less space as it uses Just In Time  compiler Android Runtime needs more space as it uses AOT.
Dalvik Virtual Mchine utilizes more battery, thus it has low battery performance Android Runtime utilizes less battery, thus it has high battery performance
Dalvik Virtual Mchine has a poor Garbage collection when compared to Android Runtime Android Runtime has a better Garbage collection when compared to DVM
In Android DVM, apps are less responsive in accordance with Android Runtime Apps here are very responsive and work smoothly.
Dalvik Runtime Virtual Machine converts bytecode every time the application launches On the other hand, Android Runtime converts the bytecode only once at the time of installation of application
It is a stable and time-tested virtual machine It is highly experimented and new
DVM is the choice of Android developers It doesn’t have a lot of support from app developers until now
DVM works better for lower internal storage devices as space occupied is less It consumes more internal storage space, as it stores compiled apps in addition to the APKs
It came prior to Android Runtime and it is replaced with Android Runtime Android Runtime is the upgraded version of Dalvik Virtual Machine and comes up with a lot of improvements

Summary

Finally in this article, we have read about the Dalvik Virtual Machine. We started with what is Virtual machine, then saw what is the Dalvik VM in Android and what it does. Then we saw what the flow of conversion is. At the end, we compared Android DVM with Android Runtime.

Hope you enjoyed the article. Do rate us on Google to get more articles on latest technologies.

Exit mobile version