Search code examples
javaprocessjvmvirtualization

Is a multi process Java program a single process in the context of the actual machine underneath the JVM it is running on?


From Wikipedia (http://en.wikipedia.org/wiki/Virtual_machine):

A process virtual machine (also, language virtual machine) is designed to run a single program, which means that it supports a single process. Such virtual machines are usually closely suited to one or more programming languages and built with the purpose of providing program portability and flexibility (amongst other things). An essential characteristic of a virtual machine is that the software running inside is limited to the resources and abstractions provided by the virtual machine—it cannot break out of its virtual environment

My question is, if we are running a multi-process Java program on a JVM (which I presume is a process virtual machine since it only virtualizes the processor, not the entire machine), will it be regarded as a single process on my actual machine?


Solution

  • You're confused between processes and processors.

    A JVM counts as a single process on your machine, yes. When you start the JVM it runs as a program and it executes Java byte code.

    A JVM can address all the processors on you machine. When you start a Thread in Java it executes on an available processor.