By Gary M. Katz, APR
Most implementations of Java technology
have been too slow, too big, or too unreliable for use in Internet
appliances and embedded devices. Insignia Solutions' Jeode platform
improves Java functionality for these resource-constrained devices,
allowing you to create and deploy Java-based
applications.
The Jeode platform offers the following tools:
- A full-featured implementation of the PersonalJava and
EmbeddedJava specifications that passed the PersonalJava and
EmbeddedJava compatibility test suites to become a "Sun-Authorized
Virtual Machine"
- Accelerated performance, robustness, and efficient memory
utilization
- Configurability and tunability to meet the needs of Internet
appliance and embedded device developers
- A turn-key solution ported and tested on a variety of
processors
- Support, training, consulting, customization, and development
tools.
Deployment of Java Technology
The Jeode platform is integrated with a suite of tuning and
programming tools to help you write and implement Java programs.
The suite includes the Jeode Embedded Virtual Machine (EVM) and the
latest PersonalJava (including AWT) or EmbeddedJava class
libraries. It offers tools for editing, compiling, and browsing
Java applications as well as runtime debug utilities, a source
level debugger, configurator, monitor, and a memory-use
analyzer.
Figure 1: Java development tool function path. Java is
translated to native code using one of two resources (either a
compiler or an interpreter), depending on if the code path is used
frequently or rarely, in order to conserve the device
resources.
The platform allows you to use the tools of your choice to edit,
compile, browse, and debug Java application through the host
computer. Special integration exists between the Jeode platform and
Metrowerks' CodeWarrior Integrated Development Environment (IDE). A
CodeWarrior plug-in is provided as part of the Jeode installation,
offering EVM-specific functionality. Standard interfaces, such as
JVMDI/JDWP, are also supported.
The EVM is a full-featured Java-compatible virtual machine and
supports embedded class libraries that are compatible with 1.1.1
PersonalJava and 1.0.3 EmbeddedJava specifications (roughly
equivalent to 1.1.7b JDK).
Improvement of Compiler Technology
Most implementations of the Java platform are interpreted and
therefore are too slow for many Internet appliances and embedded
devices. Just-in-time (JIT) compilation technology is suitable for
the desktop environment but is inappropriate for Internet appliance
and embedded classes of devices. Typical JIT implementations
require large amounts of memory, disk storage, and virtual memory
for paging segments of dynamically compiled code. JIT compilers can
also cause unpredictable delays during compilation and consume an
unbounded amount of physical and virtual memory.
Figure 2: Unlike JIT compilation technology, adaptive
dynamic compiling conserves memory and time, which are important
factors for Internet appliances and embedded devices.
In comparison, EVM's adaptive dynamic compilation technology
requires less memory, requires no disk storage for virtual memory,
and only compiles the code that represents the current performance
bottlenecks in the application or that accelerates critical aspects
of an application's code. The remainder of the application code
runs interpreted.
As the application runs, the EVM determines which code segments
execute most frequently and compiles and stores them into the
configured amount of code buffer memory. Once the allotted code
buffers are used, the EVM may recycle the buffers to optimize
performance in the given footprint.
Benchmarks conducted by Insignia customers, partners, and
independent third parties running the industry-standard Embedded
CaffeineMark 3.0 confirmed that the Jeode EVM executes Java
applications on average six to ten times faster than interpretive
VMs.
Performance Enhancement
The behavior of an Internet appliance or embedded device
application needs to be reliable, consistent, and robust.
Unscheduled pauses in the application's execution are unacceptable
in most environments, and reliability is largely determined by the
"garbage collection" strategy used to manage memory.
Figure 3: Compared to batch and incremental garbage
collection, the concurrent garbage collection used by EVM schedules
and reduces the length of pauses and also conserves memory.
The Jeode EVM implements precise, fully concurrent garbage
collection technology with memory compaction to eliminate memory
fragmentation. This approach frees up all unreferenced objects and
avoids memory leaks. The garbage collector runs as a pre-emptible
thread, and its priority can be set by the application. Because it
is implemented as a fully concurrent thread, this process adds
minimal overhead to the context switch time when switching to a
higher priority application thread.
The dynamic adaptive compiler also operates as a thread and is
pre-empted by any higher priority threads in the system. In
addition, the amount of memory used by the EVM can be bounded, and
the usage of memory may adapt dynamically depending on the current
needs of the application.
To enhance robustness, each of the EVM components handles
failures to acquire more memory. If a memory request fails, for
example, the EVM may generate an exception that can be
appropriately managed rather than causing the system to crash.
Finally, each Java thread is mapped to an underlying thread in
the real-time operating system (RTOS), providing improved
integration with native threads and tighter synergy with the RTOS
scheduler.
Reduction in Size
The platform's tools reduce the memory needed by the virtual
machine to run a Java application and also manage memory to
maximize performance within the constraints of the available
resources. The Jeode configurator assists in specifying the
parameters for a specific implementation of the EVM. Size can be
configured for functionality and performance trade-offs for each
specific application.
The actual ROM size required for the EVM can vary anywhere from
approximately 360 KB to 4.0 MB for all class libraries with English
language support to approximately 5.0 MB for all class libraries
with full international language support.
Configurable and Tunable Options
The Jeode EVM can be configured and tuned to aid in the
definition of a specific implementation for a particular Internet
appliance or embedded device. For example, you can specify the
maximum system memory, maximum heap size, maximum stack size, and
several parameters associated with dynamic compilation.
Figure 4: Configuration options allow you to set
parameters such as maximum heap size, system memory, and stack size
using the Jeode configurator.
It can be highly instrumented to provide diagnostic and
debugging insights into the EVM itself. The application's behavior
can be observed as it executes relative to parameters that are
selected to configure and tune the EVM and dynamic compiler. For
example, you can view the amount of heap that was used during
execution and watch the change in heap size as the garbage
collector runs to bound the amount of heap that is actually
consumed.
Current Applications
The platform currently supports a variety of operating systems
and target processors, including Windows CE, Pocket PC, Linux,
VxWorks, Windows NT, Windows NT Embedded, and ITRON operating
systems as well as x86, MIPS, ARM, Hitachi SH, and PowerPC
processors. Custom porting services or source code licensing is
available to expedite porting to platforms required by
customers.
It also has been integrated as a plug-in for the Internet
Explorer browser for Windows CE, PocketPC, and Windows NT Embedded.
The plug-in enables the browser to load and run Java applets.
The Jeode platform provides Java functionality for devices such
as the Compaq iPAQ Home Internet Appliance and Fujitsu PC PenCentra
200 pen tablet computer.