Wednesday, 7 November 2012

1.2.1.1 K-Virtual Machine

1.2.1.1 K-Virtual Machine

Sun’s original VM for CLDC was known as the KVM (which stood for Kauai Virtual Machine, sometimes also known as the Kilo Virtual Machine). The CLDC VM is, apart from a few differences which we shall
outline shortly, compliant with the Java Virtual Machine Specification and the Java Language Specification.
The libraries available are typically split into two categories: those defined by CLDC and those defined by a profile and its optional packages such as MMAPI and WMA. Figure 1.2 demonstrates at a high level how
these components fit together.So that the CLDC virtual machine can run within a small footprint and also to take into account additional security requirements for CLDC devices, CLDC differs from CDC in the following respects:

• no floating point support (although it has been added for CLDC
1.1) – this means that float and double numbers cannot be used and alternative means of storing these values have to be found, for example, ”string math”

• no finalization – the Object.finalize() method does not exist(Object.finalize() is used to carry out any tidying up that maybe needed when an object is collected by the garbage-collector.However, there is little, if any, practical need for this method.)
• limited error handling – only three error classes exist: java.lang.
Error, java.lang.OutOfMemory and java.lang.VirtualMachineError
• no Java Native Interface (JNI) – this is due to security concerns and
the overhead exerted by JNI on the device memory
• no user-defined class loaders – the built-in class loader cannot be
overridden, for security reasons
• no reflection
• no thread groups and daemon threads – although threading is available,
thread groups cannot be created (however, Thread arrays can
be created if a similar effect is required)
• no weak references, although these will be added to CLDC 1.1.

No comments:

Post a Comment