关于 android dalvik-cache 含义

 dalvik-cache 为android 系统目录下:data/ dalvik-cache :


该目录的定义为:

Dalvik Cache, is a temporary space used by the Java virtual machine to run Android applications. - See more at: http://www.blogsolute.com/dalvik-cache-clear-free-space/713/#sthash.hlrysOnc.dpuf
Dalvik Cache, is a temporary space used by the Java virtual machine to run Android applications. - See more at: http://www.blogsolute.com/dalvik-cache-clear-free-space/713/#sthash.hlrysOnc.dpuf
Dalvik Cache, is a temporary space used by the Java virtual machine to run Android applications. - See more at: http://www.blogsolute.com/dalvik-cache-clear-free-space/713/#sthash.hlrysOnc.dpuf
Dalvik Cache, is a temporary space used by the Java virtual machine to run Android applications.

Dalvik is the virtual machine that is used by Android. It is generally thought of as a java virtual machine, although this is not precisely correct. It uses an object model that is identical to java, and it's memory model is also nearly equivalent. But the dalvik VM is a register based VM, as opposed to java VMs, which are stack based.

Accordingly, it uses a completely different bytecode than java. However, the Android SDK includes thedx tool to translate java bytecode to dalvik bytecode, which is why you are able to write Android applications in java.

When you say "dalvik-cache", I assume you mean the /data/dalvik-cache directory that can be found on typical Android devices. When you install an application on Android, it performs some modifications and optimizations on that application's dex file (the file that contains all the dalvik bytecode for the application). It then caches the resulting odex (optimized dex) file in the/data/dalvik-cache directory, 

对应地址:http://stackoverflow.com/questions/7541281/what-is-dalvik-and-dalvik-cache


刷rom时需要删除dalvik-cache目录下:对应 http://android.stackexchange.com/questions/25859/why-do-i-need-to-wipe-dalvik-cache

发现应用安装时 会在 该目录下重新更新新的dex 文件;

应用卸载时 会删除对应的dex文件;

如果将该目录下对应的dex文件删除了,发现应用仍然能正常启动使用,但是不会重新生成dex文件;


插件化升级时问题(直接替换apk包,而不安装,则dex文件仍然为旧的):会因为虚拟机加载的字节码还是旧的导致应用启动失败;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值