- Java 2 Platform
- Java 2 Platform, Micro Edition (J2ME)
- Key Concepts of the J2ME Architecture
- The K Virtual Machine (KVM)
2.4 The K Virtual Machine (KVM)
CLDC and MIDP commonly run on top of Sun's K Virtual Machine (KVM). KVM is a compact, portable specifically designed for small, resource-constrained devices. The high-level design goal for KVM was to create a new with the following characteristics:
small, with a static memory footprint of the core of the virtual machine starting from about 60 kilobytes, depending on compilation options and the target platform,
clean, well-commented and highly portable,
modular and customizable,
as complete and fast as possible without sacrificing the other design goals.
The "K" in KVM stands for "kilo." It was so named because its memory budget is measured in tens of kilobytes (whereas desktop systems are measured in megabytes or even gigabytes). KVM is suitable for 16/32-bit microprocessors with a total memory budget of no more than a few hundred kilobytes. This typically applies to digital cellular phones, pagers, personal organizers, portable audio/video devices and small retail payment terminals.
The minimum total memory budget required by a KVM implementation is about 128 kilobytes, including the virtual machine, minimal libraries and some heap space for running Java applications. A more typical implementation requires a total memory budget of 256 kilobytes, of which at least 32 kilobytes is used as runtime heap space for applications, 60 to 80 kilobytes is needed for the virtual machine itself, and the rest is reserved for class libraries. The ratio between volatile memory (e.g., DRAM) and non-volatile memory (e.g., ROM or Flash memory) in the total memory budget varies considerably depending on the implementation, the device, the configuration, and the supported profiles. A simple KVM implementation without system class preloading support needs more volatile memory than a KVM implementation with system classes (or even applications) preloaded into the device.
The actual role of KVM in the target devices can vary significantly. In some implementations, KVM is used on top of an existing native software stack to give the device the ability to download and run dynamic, interactive, secure Java content on the device. In other implementations, KVM is used at a lower level to also implement the lower-level system software and applications of the device in the Java programming language.
For further information on KVM, refer to the KVM product web site (http://java.sun.com/products/kvm).