What can you not do on the Dalvik VM (Android's VM) that you can in Sun VM?

Question!

I know that you can run almost all Java in Dalvik's VM that you can in Java's VM but the limitations are not very clear. Has anyone run into any major stumbling blocks? Any major libraries having trouble? Any languages that compile to Java byte code (Scala, Jython etc...) not work as expected?



Answers

Just to add to the conversation, not intended to revive an old thread. I just ran across this in my search, and want to add that Jython does not work out of the box with Dalvik either. Simply trying to do a hello world example will yield the following:



If you see "Dalvik Virtual Machine internals" Google IO session, you can find Dalvik does not support generational GC.

So, it could degrade performance of frequent object creation and deletion. Java VM supports generational GC so, it would show better GC performance for the same situation.

And also, Dalvik uses trace-granuality JIT instead of method granuality JIT.

By : Wonil


Another thing that I guess could be added here is that Dalvik apparently does not preserve field order when listing the fields of a class using the reflection API. Now, the reflection API does not make any guarantees on it anyway (so ideally you shouldn't depend on it anyway), but most of the other VMs out there do preserve the order.



This video can help you solving your question :)
By: admin