![](bg3.png)
Configuration (CDC) includes almost the entire
scope of JavaSE except for GUI-related libraries. In
contrast, the Connected Limited Device
Configuration (CLDC) only contains the minimum
amount of classes necessary to enable the operation
of a JVM. In version CLDC 1.1, the previous
version has been extended by the classes double and
float, so that floating-point operations now are
enabled. On the other hand, the Java-math-library is
still not available.
On top of the configuration, a profile can be
chosen which fits the desired target application. For
example, the Mobile Information Device Profile
(MIDP) for mobile devices such as mobile phones,
or the Personal Profile for consumer electronics.
Applications written based on the former profile are
called MIDlets.
2.2 Java Virtual Machines
In this paper, four selected JVMs are installed in
diverse sensor nodes in order to be tested, namely
JamVM (Lougher, 2010), JamaicaVM (Siebert,
2002), Squawk (Oracle, 2011a) and SwissQM
(Müller, Alonso and Kossmann, 2007). The first two
JVMs are based on the JavaSE standard. The third is
based on the JavaME standard, and the fourth was
specifically developed for sensor nodes.
JamVM is an open source JVM which makes use
of the GNU Classpath (Lougher, 2010). The
developers claim that their implementation is
extremely small and still able to support the full
specification, including class-unloading and native
support. It supports several operating systems such
as Linux, Mac and Solaris as well as different
hardware architectures like PowerPC, ARM and
AMD64.
JamaicaVM is a commercial JVM of AICAS. It
provides, according to the developer, Hard Realtime
Execution, Realtime Garbage Collection, the best
trade-off between runtime performance and code
size, dynamic loading, multi-core support, and
native support. It is available for diverse operating
systems like Linux and Windows, and several
architectures like x86 and ARM. In addition to the
traditional method of building a JVM and executing
a class-file, the JamaicaVM Builder offers another
solution. All files relevant to the application (a set of
class files) and the Jamaica VM are combined into a
standalone application in a single executable file.
Squawk is a JavaME VM which targets small
resource constrained devices. Its core is mostly
written in Java. Classes are not transferred directly
to the execution environment but combined in a
suite and prelinked to each other, which results in a
reduced size of around one third of the original size.
The omission of dynamic class loading in these
immutable suites significantly decreases the start up
time of the applications. Squawk utilizes the concept
of isolates, where an application can be represented
as an object. This allows common suites to be shared
between multiple applications that run in the single
JVM which can lead to a significantly reduced
memory footprint.
Finally, SwissQM is a combination of a JVM
and a query machine (QM) that was developed
specifically to be run on platforms with TinyOS as
operating system, such as TelosB (Crossbow, 2011).
It is based on 16-bit integer values, and floating-
point types are not supported. It only supports 37
instructions of the instruction set of the JVM
specification, and adds 22 specific instructions
related to processing queries. Programs are executed
at every sampling period or when data from other
nodes arrive. It has a small footprint – 33kB of Flash
and 3kB of SRAM memory – and is able to execute
up to six QM programs concurrently in TelosB, but,
in principle, it can run an arbitrary number of
concurrent programs.
2.3 Management of Software Bundles
Furthermore, several Java based frameworks can be
found that make the exchange of software bundles
easier. Software agent platforms such as the Java
Agent DEvelopment Framework (JADE)
(Bellifemine et al., 2008), a Mobile Agent Platform
for WSNs based on JavaSun Spots (MAPS) (Aiello
et al., 2011), and the Agent Factory Micro Edition
(AFME) (Müller, 2007) are mainly found in
academic research.
There are two different application models (AM)
for the Java language. On the one hand, the
unmanaged approach exists, which is basically the
start of the static method main() when executing a
class file. On the other hand, there are several
concepts for managed AMs like applets (for web
browsers), Xlets (for advanced content on Blu-ray
discs), MIDlets (for mobile devices like mobile
phones), OSGi Bundles and the OSGi R4 Mobile
Expert Group (MEG) AM.
Here, we wish to compare the two concepts of
MIDlets and OSGi Bundles.
2.3.1 MIDlets
A device running a Mobile Information Device
Application (called a MIDlet) has an environment
PECCS 2012 - International Conference on Pervasive and Embedded Computing and Communication Systems
60