2 Connected Device Configuration and Foundation Profile

This chapter describes the fundamental components of the Oracle Java Micro Edition Embedded Client, the virtual machine that executes Java applications, two sets of the libraries that applications can use. Together, the virtual machine and core libraries described in this chapter are called the Connected Device Configuration (CDC). Supplementing CDC is the set of libraries called the Foundation Profile.

Virtual Machine

Java programs are compiled on a host computer into a portable intermediate form called Java bytecodes. In Oracle Java Micro Edition Embedded Client, files containing bytecodes are loaded to the target device where the resident CDC virtual machine (CVM) inspects, decodes, and executes them.

Interpreter

Java compilers generate machine-independent bytecodes instead of machine instructions. The interpreter is like a CPU implemented in software. It decodes and executes bytecodes, independent of what computer they were compiled on.

Dynamic Compiler

As the interpreter executes blocks of bytecodes, it tracks the number of times a block is executed. Frequently executed blocks are called hot spots. Periodically during execution, the dynamic compiler creates machine-language versions of hot spots, which are thereafter invoked instead of the interpreter. Compiled code runs about 10 times as fast as interpretation, so the investment in compilation pays off quickly.

For details on how the dynamic compiler works and how you can adjust its operation, see the Customization Guide's Tuning chapter.

Memory Management

Automatic reclamation of unusable heap objects (garbage collection) is central to the Java virtual machine. By automating memory reclamation, the garbage collector prevents common and difficult-to-diagnose programmer errors. Failing to release unneeded memory, and prematurely releasing needed memory can stop a system, which is especially serious for an embedded device. The CDC garbage collector is efficient and can be adjusted to minimize interference with user-visible activities.

For details on how the heap works and how you can adjust its configuration, see the Customization Guide's Tuning chapter.

Security

Virtual machine security features include:

Verifying the integrity of class (bytecode) files

Preventing access to unauthorized data and code

Preventing stack overflows

Executing code in a "sandbox" that prevents unauthorized access to system resources.

CDC Class Libraries

The CDC class libraries implement a minimal Java API, including subsets of these Java SE packages:

A script enabled browser is required for this page to function properly.A script enabled browser is required for this page to function properly.A script enabled browser is required for this page to function properly.A script enabled browser is required for this page to function properly.