Oracle® Java Micro Edition Embedded Client Architecture Guide Release 1.1.1 E23813-02 |
|
![]() Previous |
![]() Next |
This appendix describes the cvm
command in detail.
This appendix includes these topics:
cvm [-options] class [options ...] cvm [-options] -jar jarfile [options ...]
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 the Oracle Java Micro Edition Embedded Client Customization Guide 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:
package.classname. The classname string identifies the class having the main
method which serves as the application's starting point.
The Oracle Java Micro Edition Embedded Client Developer's Guide 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 run-time 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 B for a description of security properties for Oracle Java Micro Edition Embedded Client. |
-classpath classpath -cp classpath |
Specify an alternate user class path. The default user class path is the current directory. See Class Search Path Basics for more information on classpaths. |
|
Specify the extension class path. |
|
Set the start size of the memory allocation pool (heap). This value must be greater than 1000 bytes. The default value is 2M. |
|
Set the maximum heap size. The default value is 7M. |
|
Set the minimum heap size. 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 (for example, shell or operating system.). 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 |
|
Enable assertions in all system classes (sets the default assertion status for system classes to true). |
|
Disable assertions in all system classes. |
Table A-2 describes the Oracle Java Micro Edition Embedded Client-specific command-line options.
Table A-2 CDC-Specific Command-Line Options
Option | Description |
---|---|
|
Display build options and exit. |
|
Display build options and continue. |
|
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 the Oracle Java Micro Edition Embedded Client Customization Guide. 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. |
|
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 |
- |
This feature is useful when many new native entry points have been added. It can help avoid crashes from mismatched parameters to native routines. Expect a performance degradation when this option is used. |
Table A-3 describes the suboptions for the -Xgc
command-line option.
Table A-3 -Xgc: Suboptions
Option | Description |
---|---|
|
Set the size of the stack map cache. The default value is |
|
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.
Table A-4 -Xopt: Suboptions
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 Java stack, from |
|
Set the amount the Java stack grows when it must expand |
|
Applicable only to x86 platforms. If true (the default) double-precision floating point results are rounded. |
|
Applicable only to x86 platforms. Enable or disable Java SE |
|
Applicable only to x86 platforms. Enable Streaming SIMD Extensions, which improves the speed of floating point add, sub, mul, div and a few other operations. The default is '2' which means SSE extension version 2. The value '0' disables the extensions. All other values map to '2'. |
Table A-5 describes the flags used by the -Xtrace
command-line option. This option is useful for run-time development purposes only and is not enabled in the binary edition.
Table A-5 -Xtrace: Flags (Not Enabled in Binary Edition)
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 the Oracle Java Micro Edition Embedded Client Developer's Guide 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. The Oracle Java Micro Edition Embedded Client Customization Guide describes these options and the concepts behind them.
Table A-7 -Xjit: Options
Option | Default | Description |
---|---|---|
|
4 |
Cost of a backward 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 |
|
Set dynamic compiler trace options. See Table A-10. |
|
|
95 |
Upper code cache threshold, between |
|
true |
Unsupported. |
|
false |
Unsupported. |
|
true |
Unsupported. |
|
true |
Unsupported. |
Table A-8 describes the command-line options for selecting when to inline methods.
Table A-8 -Xjit:inline= Suboptions
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= Suboptions
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.
Table A-10 -Xjit:trace= Options
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 it was compiled successfully. |