This document covers deployment tips for particular JVMs.
Contents:
This section describes the general topics for each JVM discussed in this document.
This section includes a table that lists the basic configuration settings for mBS that are supported by the JVM.
This section contains notes relating to the mBS framework system property mbs.security described within the "System
Properties" document. Available options for this setting are none, jdk12,
and custom. If the security model implemented by the JVM is not supported by
mBS, or the JVM does not support security, none will be listed. When
enabling security with your own custom implementation (the mbs.security should not be specified or should be set to none), be sure to specify the implementation with the system property mbs.security.class
as well.
This section contains notes relating to how the particular JVM handles native
library storage, as well as notes regarding the mBS framework system property mbs.storage.native. Available options for this property are jdk11
and jdk12, the latter being the default value. If it is set to jdk11,
the additional system property mbs.storage.nativedir must be considered
as well. More information on both of the settings can be found in the "System
Properties" document.
This section lists the different archive formats that the JVM recognizes, specifically
JAR, JXE, and Tao native. This corresponds to the mBS
bundle system property mbs.loader.type, described within the "System
Properties" document.
This section covers JVM command line arguments used for customizing target environment.
This section covers commonly used build options when compiling the JVM for embedded platforms that will run mBS.
This section details specific options and settings that may impact runtime behavior of mBS.
This section includes any additional details pertinent to the JVM or running mBS.
This section contains guidelines for CEE-J version 2.7.
|
When running mBS on the CEE-J VM with enabled resource management, the mbs.threads.fix
system property must be set to true in order to use some VM-specific
techniques for resource management.
Another important system property to use is mbs.loader.setsigners,
which on the CEE-J VM should be false.
More information on the above mBS settings is available in the "System Properties" document.
These settings are for CVM version 1.0.1 and 1.1.
|
-Xms<value> - Used to set the memory allocation poolsize
in bytes. The suffixes "k" and "m" may be used to specify
the value in kilo or megabytes respectively. Default value for this is 4m.
-Xss<value> - Used to set the thread stack size in bytes.
As with the -Xms option, value may use the "k" and "m"
suffixes.
When building an implementation of Sun's CVM, the developer has the option of including components relevant to the deployment environment. The developer can change what is included in the implementation by selecting specific "Profiles", which are used to describe the environment that the JVM is going to run in. It also includes and/or excludes specific resources, which a vendor may either not require, or may have a type-specific implementation designed for.
J2ME_CLASSLIB is the build option for using a profile.
OPT_PKGS is the build option for including optional packages with
the build of CVM. This option requires that a profile is used.
Available resource manager implementations: Default Resource Manager, JDK 1.5 Resource Manager.
If using CVM 1.1, to activate the management of thread resources of the mBS framework, the framework system setting mbs.resman.class should be set to
More information about mBS resource management is available in the "Resource Management" and "System Properties" documents.
Currently, CVM represents Sun's mobile device Java environment, following the J2ME specifications.
This section contains guidelines for version 1.3.3 of the Tao VM.
|
If using Tao native file format, supported by the Standard Version of the framework, the system property mbs.loader.type
should be set to tao.
More information on this mBS setting is available in the System
Properties document.
Runtime command line arguments for memory allocation are as follows.
-M<value> - Used to set initial memory usage in k (4096
kb default).
-U<value> - Used to set the memory increment size in k (4096
kb default).
-X<value> - Used to set maximum memory usage in k (131072
kb default).
-T0 - Used to disable tracing.
Optimization of the Tao VM requires building an image for the target device. Please refer to specifics within the Tao documentation for the sysbuild and sysgen applications. However, here are some basic options to consider.
The following values can be set in the platform sysbuild configuration file, platform.sys, within the setup stage.
WANT_ADDMEM - This value allows the VM to request more memory
from the system when currently allocated memory runs out. Setting this value
requires that ADDMEM_NEXT and ADDMEM_MAX be set
as well.ADDMEM_NEXT : This value defines the amount of memory that
will be requested when the current memory allocation becomes insufficient.ADDMEM_MAX : This value defines the maximum amount of memory
that will be allocated.There are numerous other values that can be set and may have an effect on the target system, such as defining the type of memory required, the type of file system required, and setting hardware requirements (sound, video, ports, etc).
.memory can be used to configure the memory stage. This instruction
allows the developer to allocate available memory, and specify details regarding
its usage. Within this instruction are flags for setting the name of the memory
object, its size, base address, attributes, as well as more advanced instructions
for defining static loaded data and determining its usage.
When building the actual image file, the -s command line argument
will remove debugging information from tools.
Make sure also to set the mbs.cl.tao.fix system property to true to enable correct loading of classes.
When running mBS on Tao Intent with enabled resource management and with mbs.cl.tao.fix equal to false, the mbs.threads.fix system property must be set to true in order to use some VM-specific techniques for resource management. More information on this mBS setting is available in the "System Properties" document.
Tao does not use system defined classpaths. All command line paths need to be declared in absolute terms.
|
When compiling bundles in JXE format, be sure to check the SmartLinker (for J9 2.2) command line options for creating files that are compatible with the specifics of the target device. Some of the options available are as follows.
-le - File created is Little Endian byte format. This is default
for SmartLinker.
-be - File created is Big Endian byte format.
The J9 VM comes preconfigured with optimization settings specific to the target platform, in terms of CPU and OS. Default values for the following will vary between platforms. These settings can be modified with the following command line arguments.
This section contains the most useful command line options for running the mBS framework on J9 2.2 and J9 2.3.
-Xint - If present runs only interpreted code and not precompiled code. Equivalent to -Xnoat.
-Xgcpolicy:optavgpause - Used to reduce the time of garbage collection pauses and to limit the effect that the increased heap size has on the garbage collection pause. This option is suitable for platforms with large heaps.
Values for the following options are expressed in bytes. The suffixes "k" and "m" may be used to specify the value is in kilo- or mega-bytes respectively.
-Xmca<value> - Used to set RAM class segment increment.
-Xmco<value> - Used to set ROM class segment increment.
-Xmn<value> - Used to set new space size.
-Xms<value> - Used to set old space size.
-Xmo<value> - Same as -Xms.
-Xmoi<value> - Used to set old space increment.
-Xmx<value> - Used to set memory maximum.
-Xmso<value> - Used to set OS thread stack size.
-Xmr<value> - Used to set remembered set size.
-Xiss<value> - Used to set initial Java thread stack size.
-Xss<value> - Used to set maximum Java thread stack size.
-Xmca8K -Xmco8K -Xmoi128K -Xmn256K -Xmo512K
IBM recommends that the JAVA_HOME variable not be set. This value
is generally set to the root directory of the J9 runtime installation. Default
value is one directory above where the actual VM can be found. This setting
ensures that certain files such as classes.zip, locale.zip, and
charconv.zip can be found.
Available resource manager implementations: Default Resource Manager, J9 Resource Manager.
If using the resource management capabilities of J9 jclRM, the framework system setting
mbs.resman.class should be set to
for J9 2.x.
More information about mBS resource management is available in the "Resource Management" and "System Properties" documents.
Another important setting for using the mBS on J9 is the mbs.loader.setsigners
system property, which must be false for J9, as described in the "System
Properties" document.
If using JXEs, the system property mbs.loader.type should be
set to jxe22 for J9 2.2 and J9 2.3. Refer
to the "System Properties" document for more information on this setting.
Make sure to use the -Xbootclasspath command line argument when starting the framework, and that the starting
class is not specified in the command line. Also refer to the J9 documentation
for additional information.
|
-Xms<value> - Used to set initial Java heap size.
-Xmx<value> - Used to set maximum Java heap size.
-Xss<size> - Used to set Java thread stack size.
Available resource manager implementations: Default Resource Manager, JDK 1.5 Resource Manager.
If using the JDK 1.5 and later, to have management of active threads, the framework system setting mbs.resman.class should be set to
More information about mBS resource management is available in the "Resource Management" and "System Properties" documents.
Another important setting for using the mBS framework JDK1.1.x is the mbs.loader.setsigners
system property taht should be set to true. Refer to the "System
Properties" document for a more detailed description on the property.
This section provides guidelines for Jeode 1.11.
|
When starting mBS on Jeode, make sure that jeode.security
is set to true.
Jeode supports many property settings. These settings may be declared in 2 different ways.
-X@:<filename> command line argument.-D<property>=<value> command line argument.The following memory system properties may be important for embedded devices running mBS.
jeode.evm.memory.overallSize - Used to determine the maximum
dynamic memory allowed at runtime by Java objects and for EVM data.jeode.evm.memory.sysLimit - Used to determine the maximum amount
in bytes of dynamic memory that can be allocated to Jeode system objects.jeode.evm.memory.sysStart - Used to determine how much memory in bytes
the system heap will start with. The system heap will never drop below this
value.jeode.evm.memory.sysExtend - Used to provide a hint to the
EVM regarding how much to grow the EVM data memory when necessary.jeode.evm.memory.javaLimit - Used to define the maximum amount
of dynamic memory to allocate to the Java heap.jeode.evm.memory.javaStart - Used to determine how much memory
the Java heap will start with. The Java heap will never drop below this value.jeode.evm.memory.javaExtend - Used to provide a hint to the
EVM regarding how much to increase the Java object memory when necessary.jeode.evm.memory.stackSize - Used to determine the maximum
stack size requested from the OS for each JeodeRuntime thread (including any
Java threads). Note under certain OSs (ex.Win32), this setting is effectively
ignored.jeode.evm.memory.stackOverflowZone - When a thread enters this
zone, a stack overflow exception will be thrown. This value needs to be less
than the stack size setting. A value of 0(zero) indicates that overflow checks
should not be performed. In addition to these settings, Jeode also supports the following command line arguments.
-ms<value> - Similar to jeode.evm.memory.sysStart described
above.
-mx<value> - Used to set the maximum size for the Java heap.
-noverify - Used to turn off bytecode verification.
-oss<value> - Used to specify the size of the native stack.
-ss<value> - Used to specify the size of the Java stack.
There are numerous other configuration settings for different components such as the runtime compiler, local and remote console settings, debugging, and others. Please refer to the Jeode documentation for more information.
When the mBS framework is running on the Jeode VM, the mbs.loader.setsigners
system property should be set to true. Refer to the "System
Properties" document for a more detailed description on the property.
This section contains guidelines for version 3.22 of the JSCP VM.
|
c2ROM is a utility that can convert Java classes into VM native code. Please see the JSCP documentation for more information on this tool.
f2ROM is a utility that can convert any files other than Java classes for inclusion within an application ROM image.
-mi - Allows multiple instances of JSCP to run concurrently.
-ml<value> - Sets the Java memory limit in KB.
-noverify - Turns off class verification.
-nojit - Disables JIT.
-D<name>=<value> - Sets Java system property <name>
to value <value>.
Please refer to the JSCP user documentation for configuring and implementing the the .c and .h files that will include custom runtime configuration information.
This section contains deployment tips for version 1.1.4 of the Kaffe VM.
|
-ss - Used to set the maximum stack size.
-mx - Used to set the maximum heap size.
-ms - Used to set the initial heap size.
This section provides tips for mBS deployment on the Perc VM version 4.2.0.
|
Perc supports JIT and AOT compilations. Please refer to the PERCAccelerator for compiling code with these options. NewMonics suggests removing JIT from the Perc VM and using AOT compilation for bundles. The effect is reduced ROM memory footprint with the speed benefits of JIT (via AOT).
-js <value> - Used to set the initial size of the Java stack.
Value is in bytes.
-numregs <value> - Used to set the initial number of memory
regions created.
-maxregs <value> - Used to set the maximum number of memory
regions to use.
-regsize <value> - Used to set the memory region size. Value
is in MB.
For resource constrained devices, NewMonics recommends building a custom version of the Perc JVM tailored to the particular environment. This allows the developer to include such options as AOT, JIT, as well as altering default classes and startup applications. Please refer to the Perc documentation for more details.
The section contains deployment tips for version 3.1 of the PJEE VM.
|
There are several different products that are related to PersonalJava that bear mentioning here to avoid confusion.
PJava, also known as PJAE or PersonalJava Application Environment: This is the PersonalJava JVM specification produced by Sun for use on mobile devices. In addition to this, there are several other products that are also commonly referred to as PJava, although they are actually just VMs that implement the PersonalJava specification produced by Sun.
This product has been discontinued by Sun, in favor of their later embedded device specification J2ME. Please see notes on CVM for implementation with this new specification.
Personal Java Emulation Environment, also known as PJEE: PJEE is a Personal Java emulation environment designed for emulating Personal Java running on an embedded device.