Google I/O 2008 - Dalvik Virtual Machine Internals

Google for Developers · 187K views · 2008 · 1:01:34

Open on YouTube

Compilers, interpreters & program analysisOperating systems & kernelstalkdated

Why Hacker News recommends it

HN points to it as the primary source on Dalvik's dex bytecode, register-based design and memory-saving choices.

What it is

Dan Bornstein's Google I/O 2008 talk on the internals of Dalvik, the virtual machine that runs Android code. It covers the motivation for its design, the dex format and its register-based interpreter, plus tips for writing code that suits the platform.

Recommended by 1 HN commenters across 1 different months, 2012 to 2018.

What Hacker News said

Recommends yonran · 2012-05 · on “Android Ported to C#”

Here's Dan Bornstein's talk at Google I/O 2008 about the dex format and the original Dalvik interpreter: [this video] I'm not sure how useful it is in comparing the Dalvik JIT to MonoTouch though.

Cites ttuominen · 2013-01 · on “Ubuntu for phones”

I agree: within the Android ecosystem and even within the ARM family, bytecode provides portability: you don't have to compile and distribute apps for different versions of the ARM architecture. It's paradoxical however that to increase the portability of certain types of apps across mobile ecosystems, eg. iOS and Android, and now Ubuntu, your best bet can be to write the portable part in native C or C++, bypassing the Dalvik layer using JNI/NDK. This is apparently the common way to make cross-platform mobile games. On memory consumption: I haven't made any measurements, but the Android .dex bytecode format has been designed with low space requirements in mind. See [this video] . However, all app

Cites chubot · 2017-01 · on “Dismissing Python Garbage Collection at Instagram”

This is a great post. I like how they walked through all the steps and especially the "perf" tool. Ruby has a patch to do the same thing -- increase sharing by moving reference counts out of the object itself: Index here: [LINK] First post in a long series: [LINK] I think these patches or something similar may have made it into Ruby 2.0: [LINK] [LINK] The Dalvik VM (now replaced by ART) also did this to run on phones with 64 MiB of memory: [this video] I think PHP might do it too. It feels like Python should be doing this as well.

Cites jashmatthews · 2018-09 · on “Profiling CPython at Instagram (2017)”

There's an experimental branch for Ruby: [LINK] Dalvik also uses a register-based bytecode. The early versions of Android needed a more efficient interpreter. Dan Bornstein's talk: [this video] A classic paper on Register vs Stack VMs: [LINK]