easip-web1
October 25th, 2010 By Owais

Analysis of Dalvik Virtual Machine and Class Path Library

ABTRACT

Android is an open source complete software stack (that includes operating system, Linux kernel, middleware and some useful applications) for mobile platforms; proposed by Open Handset Alliance, a global alliance of leading technology and mobile industries. Android platform has its own virtual machine dalvik. Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple instances of the VM efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included dx tool. The Dalvik VM relies on the Linux kernel for underlying functionalities such as threading and low-level memory management.

OBJECTIVES

In this report we have discussed virtual machines, especially Dalvik virtual machine in detail and their runtime libraries in comparison with JVM’s libraries. The report answers questions, such as why Dalvik was needed and how it overcomes the deficiencies of its counterpart Java virtual machine. Moreover, this report also gathers some statistics related to the Android and iPhone market place. Most of comparative statistics suggest that Android is still far be-hind iPhone in the consumer market, both in terms of revenue generation and size captured. However, it is also evident how quickly Android has advanced in market to its current size of 7000 applications and almost 3000 publishers.

INTRODUCTION

The rise in the usage of mobile devices (cell phones, PDAs, and smart phones) and rapid growth in demand of their software application development has convinced the manufacturers towards open source software stacks. Open source shift the control of software from vendors to customers. The source code of open software is available to everyone; hence, users or third party organizations can learn from it and can extend it according to their needs. Open source leads to rapid growth and development in software industry. It also allows a common platform for different vendors to develop and enhance the capabilities of software distributions. Experts (belonging to different companies) collaborate with each other and the new ideas travel the globe in an instant. An example of such new and emerging opensource platform is the Google’s Android smartphone. Android is provided with so much attractive features and technological world’s experts are getting involved in developing new android applications. The graph presented in Fig 1 mentions the top 10 grossing applications in the US Android Market based on estimated downloads and current price.

Figure 1: Monthly Statistics of new Android Projects
DALVIK VIRTUAL MACHINE A Virtual Machine (VM) is a software environment that can be an emulator, an operating system or a complete hardware virtualization, that has an implementation of resources without the actual hardware being present. Dalvik is a virtual machine that is designed specifically for the Android platform. Named after the fishing village of Dalvik in Iceland, it was originally written by Dan Bornstein. Unlike most of virtual machines that are stack based, Dalvik architecture is register based. It is optimized to use less space. The interpreter is simplified for faster execution. It executes its own Dalvik byte code rather than Java byte code. All mobile systems features little RAM, low performance CPU, slow internal flash memory, and limited battery power. Therefore, a need was felt for a VM that could provide better performance with limited resources. So came Dalvik, designed to run on Linux kernel, which provides process threading, pre-processing for faster application execution, User ID based security procedures and inter-process communication. Dalvik works on low resourced ARM devices (Advanced RISC Machines), is 32-bit processor architecture based on Reduced instruction set computer developed by ARM limited. ARM processors are used because of their simple architecture making it suitable for low power devices such as cell phones. Dalvik can also be ported to run on x86 systems.
Supported Functionalities are:
  • Dalvik execution file format
  • Dalvik instruction set
  • J2ME CLDC API
  • Multi-threading

Internals:

  • Byte-code
  • Java Byte-code
  • Dalvik Byte-code
  • Dex File Format

Conversion: of Java Byte-code to Dalvik Byte-code:

To view a detailed report click here

Leave a Reply


(Required)

(Required)