How java works in android through memory object heap allocation

时光毁灭记忆、已成空白 提交于 2019-12-05 21:38:54

Android re-implemented the Java Virtual Machine with their own Dalvik Virtual Machine. Unlike the JVM which is stack-based, Dalvik is register based. You can see a comparison between the two here:

http://en.wikipedia.org/wiki/Dalvik_(software)#Performance

Yes Dalvik VM has a heap just like the JVM - just not a stack. It is 100% compatible with any Java 1.6 source code (1.7 support is slowly coming, and preliminary support is available in Android Studio). So in your 3 steps:

  1. Inserts the reference to myObj in a register
  2. Allocates a new space for object of type MyClass in the heap
  3. Appoints this new space's reference to myObj
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!