Oracle® Java Micro Edition Connected Device Configuration Runtime Guide Release 1.1.2 for Oracle Java Micro Edition Embedded Client A12345-01 |
|
Previous |
Next |
cvm
ReferenceThis appendix describes the cvm
command in detail. For the Oracle Java ME Embedded Client, see the Oracle Java Micro Edition Embedded Client Reference Guide for detailed information about cvm
for the Oracle Java ME Embedded Client.
cvm
launches a Java application. It does this by starting a Java virtual machine, loading its system classes, loading a specified application class, and then invoking that class's main
method, which must have the following signature:
public static void main(String args[])
The first non-option argument to cvm
is the name of the top-level application class with a fully-qualified class name that contains the main
method. The Java virtual machine searches for the main application class, and other classes used, in three locations: the system class path, the extension class path and the user class path. See Section 3.3, "Class Search Path Basics," for more information about Java class paths. Non-option arguments after the main application class name are passed to the main
method.
If the -jar
jarfile command-line option is used, cvm
launches the application in the jar
file. The manifest of the jar
file must contain a line of the form MainClass:
classname. The classname string identifies the class having the main
method which serves as the application's starting point.
Section 3.1, "Launching a Java Application," has more information about launching Java applications with cvm
.
cvm
borrows some of its command-line options from java, the Java SE application launcher. Other options are unique to cvm
and may require certain build options to enable the necessary runtime features. For command-line options that take a size parameter, the default units for size are bytes. Append the letter k
or K
to indicate kilobytes, or m
or M
to indicate megabytes.
Table A-1 describes the command-line options that are shared with the Java SE application launcher.
Table A-1 Java SE Command-Line Options
Option | Description |
---|---|
-help |
Display usage information and exit. |
|
Display product version information and continue. |
|
Display product version information and exit. |
|
Display build version information and exit. |
-Dproperty=value |
Set a system property value. See Appendix C, "Java ME System Properties" for a description of security properties for CDC. |
-classpath classpath -cp classpath |
Specify an alternate user class path.Foot 1 The default user class path is the current directory. |
|
Specify the extension class path.Foot 2 |
|
Set the start size of the memory allocation pool (heap). This value must be greater than 1000 bytes. The default value is 2M. NOTE: This option is ignored by the generational garbage collector, though it could be used by other garbage collectors. |
-Xmxsize |
Set the maximum heap size (high water mark). The default value is 7M. |
|
Set the minimum heap size (low water mark). The default value is 1M. |
|
Each Java thread has two stacks: one for Java code and one for native code. The maximum native stack size of the main thread is determined by the native application launcher (e.g. shell, OS, etc.). For subsequent threads, the maximum native stack size is set by the The default value is |
-enableassertions [:<package>… | :<class> ] -ea [:<package>... | :<class>] |
Enable Java assertions. These are disabled by default. With no arguments, this switch enables assertions for all user classes. With one argument ending in If a single command line contains multiple instances of these switches, they are processed in order before loading any classes. So, for example, to run a program with assertions enabled only in the package
The
|
-disableassertions [:<package>… | :<class> ] -da [:<package>... | :<class> ] |
Disable Java assertions. This is the default behavior. With no arguments, The |
-enablesystemassertions -esa |
Enable assertions in all system classes (sets the default assertion status for system classes to true). |
|
Disable assertions in all system classes. |
Footnote 1 See Section 3.3, "Class Search Path Basics" and http://download.oracle.com/javase/1.4.2/docs/tooldocs/tools.html
for more information about class search paths.
Footnote 2 See Section 3.3, "Class Search Path Basics" and http://download.oracle.com/javase/1.4.2/docs/tooldocs/tools.html
for more information about class search paths.
Table A-2 describes the CDC-specific command-line options.
Table A-2 CDC-Specific Command-Line Options
Option | Description |
---|---|
|
Display build options and exit. |
|
Display build options and continue. |
-XappName=value |
Specify the application name for QPE. This is used to identify the |
|
Perform class verification.
The default value is |
|
Make sure all resources are freed and the VM destroyed upon exit. This is the default for non-process-model operating systems, but is not needed for process-model operating systems, such as Linux. |
|
Specify GC-specific options. The default GC is the generational garbage collector described in Chapter 3, "Running Applications." See Table A-3 for a description of the suboptions. Other garbage collectors are unsupported. |
|
Control the Java stack. See Table A-4 for a description of the suboptions. The different suboptions can be appended into a single argument with name/value pair separated by commas. |
-XtimeStamping |
Enable timestamping. |
|
Turn on trace flags. Table A-5 shows the hexadecimal values to turn on each trace flag. To turn on multiple flags, bitwise-OR the values of all the flags you want to turn on, and use that result as the |
Table A-3 describes the suboptions for the -Xgc
command-line option.
Option | Description |
---|---|
|
Set the size of the stack map cache. The default value is |
stat |
Collect and display garbage collection statistics. |
|
Set the size of the young object generation. NOTE: this option is specific to the default generational collector. The default value is |
Table A-4 describes the suboptions for the -Xopt
command-line option, which controls the size of the Java stack. This option is useful for runtime development purposes only and is unsupported.
Suboption | Description |
---|---|
|
Set the initial size of the Java stack, from <32…65536>. The default for JIT-based systems is |
|
Set the maximum size of the stack, from |
|
Set the amount the stack grows when it needs to expand |
Table A-5 describes the flags used by the -Xtrace
command-line option. This option is useful for runtime development purposes only and is unsupported.
Table A-5 -Xtrace:
flags (unsupported)
Value | Description |
---|---|
|
Opcode execution. |
|
Method execution. |
|
Internal state of the interpreter loop on method calls and returns. |
|
Fast common-case path of Java synchronization. |
|
Slow rare-case path of Java synchronization. |
|
Mutex locking and unlocking operations. |
|
Consistent state transitions. Garbage Collection (GC)-safety state only. |
|
GC start and stop notifications. |
|
GC root scans. |
|
GC heap object scans. |
|
GC object allocation. |
|
GC algorithm internals. |
|
Transitions between GC-safe and GC-unsafe states. |
|
Class static initializers. |
|
Java exception handling. |
|
Heap initialization and destruction, global state initialization, and the safe exit feature. |
|
Read and write barriers for GC. |
|
Generation of GC maps for Java stacks. |
|
Class loading. |
|
Class lookup in VM-internal tables. |
|
Type system operations. |
|
Java code verifier operations. |
|
Weak reference handling. |
|
Class unloading. |
|
Class linking. |
Table A-6 describes the command-line options available with the CVM_JVMTI
build option. See Chapter 6, "Developer Tools," for an example of how to use these command-line options.
Table A-6 JVMTI Options
Option | Description |
---|---|
|
Enable VM-level debugging support. |
|
Enable feature in shared library. For example, |
Table A-7 describes the command-line options available with the CVM_JIT=true
build option. See Chapter 3, "Running Applications," for an example of how to use these command-line options.
Option | Default | Description |
---|---|---|
|
4 |
Cost of a backwards branch, between |
|
20000 |
The popularity threshold for a given method, between |
|
512k |
Size of code cache where compiled methods are stored, between |
|
policy |
When to compile methods. See Table A-9 for descriptions of the suboptions for |
|
20 |
Cost of an interpreted-to-interpreted method call, between |
|
all |
Perform method inlining when compiling. See Table A-8 for descriptions of the suboptions for |
|
90% |
Lower code cache threshold, between |
|
65535 |
Maximum size of a compiled method, between |
|
68 |
Maximum size of an inlined method, between |
|
12 |
Maximum inlining depth of inlined methods/frames, between |
|
512k |
Maximum working memory size for the dynamic compiler, between |
|
50 |
Cost for transitioning between a compiled method and an interpreted method, and vice versa. Between |
|
16 |
The floor value for |
|
true |
Policy triggered decompilations. If |
trace=suboption |
Set dynamic compiler trace options. See Table A-10. |
|
|
95 |
Upper code cache threshold, between |
|
true |
Unsupported. |
|
false |
Unsupported. |
|
true |
Unsupported. |
|
true |
Unsupported. |
|
|
Enable/disable AOTC. |
|
AOTC file path. |
|
|
|
Recompile AOTC code when this option is set to |
|
672K |
Size for the code cache used for AOTC. |
|
File containing a list of methods to be compiled and saved for AOTC. |
Table A-8 describes the command-line options for selecting when to inline methods.
Table A-8 -Xjit:inline=
suboption
Suboption | Description |
---|---|
|
Enable all the options listed below to perform inlining whenever possible. The default. |
|
Do not perform inlining. |
|
Perform inlining on virtual methods. |
|
Perform inlining on nonvirtual methods. |
|
Virtual hints. Use hints gathered while interpreting a method to choose a target method to get inlined when an |
|
Interface hints. Use hints gathered while interpreting a method to choose a target method for inlining when an |
|
Inline virtual synchronized methods. Off by default. Unsupported. |
|
Inline non-virtual synchronized methods. Off by default. Unsupported. |
|
Inline privileged methods specified by |
Table A-9 describes the top-level command-line options that control dynamic compiler policies.
Table A-9 -Xjit:compile
=suboption
Suboption | Description |
---|---|
|
Compile according to existing compilation policy parameters such as |
|
Compile all methods aggressively. Note: this hurts performance and should be used only for testing the dynamic compiler. |
|
Do not compile any methods. |
Table A-10 describes the command-line options for controlling dynamic compiler tracing. These options require a build with CVM_TRACE_JIT=true
. These options are experimental and unsupported.
Suboption | Description |
---|---|
|
Print information regarding the conversion of Java bytecodes to the JIT internal representation (IR), including a complete dump of all IR nodes. |
|
Print the generated code in a format similar to the assembler language of the target processor. If the build option |
|
Print method inlining information during the bytecode to IR pass, such as which methods were inlined and which ones were not. |
|
Print information about optimizations done in the bytecode to IR pass. |
|
Print a message when compilation of a method is triggered by on stack replacement (OSR). |
|
Print statistics gathered during compilation. |
|
Print a line of status each time a method is compiled. The output includes the name of the method and whether or not it was compiled successfully. |