DALVIK VIRTUAL MACHINE

Java has always been marketed as “write once, run anywhere.”  The capability has largely been 

made possible by the Java Platform, the foundation of which is the Java Virtual Machine (JVM).  

While Google has selected Java as the language for developing Android applications, it has 

chosen to abandon both JME and the JVM in favor of an alternative deployment target, the Dalvik 

virtual machine.

 

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 VMs ef?ciently. 

The Dalvik VM executes ?les 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 functionality such as threading and 

low-level memory management

 

In standard Java environments, Java source code is compiled into Java bytecode, which is stored 

within .class ?les.  The .class ?les are read by the JVM at runtime.

On the Android platform, Java source code is still compiled into .class ?les.  But after .class ?les 

are generated, the “dx” tool is used to convert the .class ?les into a .dex, or Dalvik Executable, ?le.  

Whereas a .class ?le contains only one class, a .dex ?le contains multiple classes. It is the .dex ?le 

that is executed on the Dalvik VM.  

The .dex ?le has been optimized for memory usage and the design is primarily driven by 

sharing of data.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值