Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

JVM and DVM both provide virtual environment. JVM doesn't need to be in every process. why DVM need to be in every process? Thanks.

share|improve this question

Neither DVM nor JVM runs on every processes. Natively compiled applications (e.g. the ones you see inside Terminal Emulator) are not associated with any DVM or JVM.

And even when you only count Android "apk" applications, the overhead of having JVM/DVM on (nearly) every process' address space is minimal since they are a shared dynamic library so Linux will smartly load them once in a copy-on-write buffer for the whole OS.

share|improve this answer
Ah, I forgot about native C++ code, I suppose that wouldn't need to go through the JVM then. – Bryan Denny Apr 1 '11 at 12:55
+1 for addressing the overhead. – Matthew Read Apr 1 '11 at 14:00
I am a little confused. on android developer website: – user4009 Apr 1 '11 at 22:56
I am still a little confused. on android developer website: line7: "Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications. " but i think if we use JVM, JVM won't be in each process, but application's code still can be isolated from other applciations. – user4009 Apr 1 '11 at 23:08
@librangel: Just as every Java apps need JVM, every Dalvik apps need DVM. That line is implicitly talking about Dalvik processes since most of Android applications are Dalvik applications. Native processes do not need DVM. Memory space isolation (virtual address space) is a feature of the Linux kernel, and each Dalvik application runs in their own process in their own virtual address space, however the kernel can smartly share memory used by shared libraries such as the DVM. So although physically they occupy the same area in RAM, each application conceptually has their own copy of DVM. – Lie Ryan Aug 11 '11 at 15:18

Android applications run Dalvik bytecode, so the DVM needs to be running. Just like how running Java bytecode on a PC requires a JVM to run.

share|improve this answer
I think java virtual machine doesn't need to run in EVERY process, right? Then why DVM needs to run in EVERY process? – user4009 Apr 1 '11 at 1:13
@librangel It does need to run for every process. Something has to translate the byte code (what Java apps are "compiled" into) into machine language (that the processor executes) – Bryan Denny Apr 1 '11 at 1:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.