Quick Links:

Releases | Mailing Lists | Source Control | Issue Tracker | Regression Tests

9 Running Jikes RVM

Chapter 9
Running Jikes RVM

JikesTM RVM executes Java virtual machine byte code instructions from .class files. It does not compile JavaTM source code. Therefore, you must compile all Java source files into bytecode using a Java compiler.

For example, to run class foo with source code in file foo.java:

% javac foo.java 
% rvm foo

The general syntax is

rvm [rvm options...] class [args...]

You may choose from a myriad of options for the rvm command-line. Options fall into two categories: standard and non-standard. Non-standard options are preceded by ”-X:” and differ between virtual machines (e.g. Jikes RVM’s options may not be available in HotSpot and vice-versa).

9.1 Standard Command-Line Options

We currently support a subset of the JDK 1.5 standard options. Below is a list of all options and their descriptions. Unless otherwise noted each option is supported in Jikes RVM.



-cp or -classpath (directories and
zip/jar files separated by ”:”)

set search path for application classes and resources


set a system property


enable verbose output


print current VM version and terminate the run


print current VM version and continue running


like ”-version”, but with more information

-? or -help

print help message


print help on non-standard options


execute a jar file


load Java programming language agent, see java.lang.instrument

9.2 Non-Standard Command-Line Options

It is generally the case that the non-standard options may change from one release to another. However, the core and memory non-standard options that are listed here don’t change often.

The bulk of the non-standard options are grouped according to the subsystem that they control. See below for details.

9.2.1 Core Non-Standard Command-Line Options




Print out additional lowlevel information for GC and hardware trap handling


Print out additional information while VM is booting, using verbosity level <number>


Write standard error message to <filename>


Read boot image code from <filename>


Read boot image data from <filename>


Read boot image ref map from <filename>


Load the org.jikesrvm.* and java.* classes from <path>


The number of processors that the garbage collector will use

9.2.2 Memory Non-Standard Command-Line Options




Initial size of heap where <number> is an integer, an extended-precision floating point or a hexadecimal value and <unit> is one of T (Terabytes), G (Gigabytes), M (Megabytes), pages (of size 4096), K (Kilobytes) or <no unit> for bytes


Maximum size of heap. See above for definition of <number> and <unit>

9.2.3 Subsystem Non-Standard Command-Line Options

The other non-standard command line options are not listed here because they will change from time to time. To get a current list of these options, you can do the following:

9.3 Running Jikes RVM with Valgrind

Jikes RVM can run under valgrind, as of 29-Aug-2007. Applying a patch of this revision to release 3.2.1 should also produce a working system. Versions of valgrind CVS prior to release 3.0 are also known to have worked. The current git HEAD should also work with Valgrind.

To run a Jikes RVM build with valgrind, use the -wrap flag to invoke valgrind, eg

rvm -wrap "path/to/valgrind --smc-check=all <valgrind-options>" <jikesrvm-options> ...

Note that the full path to valgrind must be specified.

This will insert the invocation of valgrind at the appropriate place for it to operate on Jikes RVM proper rather than a wrapper script.

Under some circumstances, valgrind will load shared object libraries or allocate memory in areas of the heap that conflict with Jikes RVM. Using the flag -X:gc:eagerMmapSpaces=true will prevent and/or detect this. If this flag reveals errors while mapping the spaces, you will need to rearrange the heap to avoid the addresses that Valgrind is occupying.

If you’re using a recent Jikes RVM version (later than 3.1.3), you may want to change the line

private static final boolean ALLOW_READS_OF_UNDEFINED_MEMORY = true;

in org.jikesrvm.jni.JNIGenericHelpers to

private static final boolean ALLOW_READS_OF_UNDEFINED_MEMORY = false;

to prevent false positives from Valgrind.