Running the RVM

Jikes RVM executes Java virtual machine byte code instructions from .class files. It does not compile Java source code. Therefore, you must compile all Java source files into bytecode using your favorite 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:".

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.

Option Description
{-cp or -classpath} <directories and zip/jar files separated by ":"> set search path for application classes and resources
-D<name>=<value> set a system property
-verbose:[ class | gc | jni ] enable verbose output
-version print current VM version and terminate the run
-showversion print current VM version and continue running
-fullversion like "-version", but with more information
-? or -help print help message
-X print help on non-standard options
-jar execute a jar file
-javaagent:<jarpath>[=<options>] load Java programming language agent, see java.lang.instrument

Non-Standard Command-Line Options

The non standard command-line options are grouped according to the subsystem that they control. The following sections list the available options in each group.

Core Non-Standard Command-Line Options

Option Description
-X:verbose Print out additional lowlevel information for GC and hardware trap handling
-X:verboseBoot=<number> Print out additional information while VM is booting, using verbosity level <number>
-X:sysLogfile=<filename> Write standard error message to <filename>
-X:ic=<filename> Read boot image code from <filename>
-X:id=<filename> Read boot image data from <filename>
-X:ir=<filename> Read boot image ref map from <filename>
-X:vmClasses=<path> Load the com.ibm.jikesrvm.* and java.* classes from <path>
-X:cpuAffinity=<number> The physical CPU to which first virtual processor is bound
-X:processors=<number|"all"> The number of virtual processors

Memory Non-Standard Command-Line Options

Option Description
-Xms<number><unit> 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
-Xmx<number><unit> Maximum size of heap. See above for definition of <number> and <unit>

Garbage Collector Non-Standard Command-Line Options

These options are all prefixed by -X:gc:.

Boolean options.

Option Description
protectOnRelease Should memory be protected on release?
echoOptions Echo when options are set?
printPhaseStats When printing statistics, should statistics for each gc-mutator phase be printed?
xmlStats Print end-of-run statistics in XML format
eagerCompleteSweep Should we eagerly finish sweeping at the start of a collection
fragmentationStats Should we print fragmentation statistics for the free list allocator?
verboseFragmentationStats Should we print verbose fragmentation statistics for the free list allocator?
verboseTiming Should we display detailed breakdown of where GC time is spent?
noFinalizer Should finalization be disabled?
noReferenceTypes Should reference type processing be disabled?
fullHeapSystemGC Should a major GC be performed when a system GC is triggered?
ignoreSystemGC Should we ignore calls to java.lang.System.gc?
variableSizeHeap Should we shrink/grow the heap to adjust to application working set?
eagerMmapSpaces If true, all spaces are eagerly demand zero mmapped at boot time
sanityCheck Perform sanity checks before and after each collection?

Value options.

Option Type Description
markSweepMarkBits int Number of bits to use for the header cycle of mark sweep spaces
verbose int GC verbosity level
stressFactor bytes Force a collection after this much allocation
metaDataLimit bytes Trigger a GC if the meta data volume grows to this limit
boundedNursery bytes Bound the maximum size of the nursery to this value
fixedNursery bytes Fix the minimum and maximum size of the nursery to this value
debugAddress address Specify an address at runtime for use in debugging

Base Compiler Non-Standard Command-Line Options

Boolean options

Option Description
edge_counters Insert edge counters on all bytecode-level conditional branches
invocation_counters Select methods for optimized recompilation by using invocation counters

Opt Compiler Non-Standard Command-Line Options

Boolean options.

Option Description
local_constant_prop Perform local constant propagation
local_copy_prop Perform local copy propagation
local_cse Perform local common subexpression elimination
global_bounds_check Perform global Array Bound Check elimination on Demand
monitor_removal Try to remove unnecessary monitor operations
invokee_thread_local Compile the method assuming the invokee is thread-local
no_callee_exceptions Assert that any callee of this compiled method will not throw exceptions?
simple_escape_ipa Eagerly compute method summaries for simple escape analysis
field_analysis Eagerly compute method summaries for flow-insensitive field analysis
scalar_replace_aggregates Perform scalar replacement of aggregates
reorder_code Reorder basic blocks for improved locality and branch prediction
reorder_code_ph Reorder basic blocks using Pettis and Hansen Algo2
inline_new Inline allocation of scalars and arrays
inline_write_barrier Inline write barriers for generational collectors
inline Inline statically resolvable calls
guarded_inline Guarded inlining of non-final virtual calls
guarded_inline_interface Speculatively inline non-final interface calls
static_splitting CFG splitting to create hot traces based on static heuristics
redundant_branch_elimination Eliminate redundant conditional branches
preex_inline Pre-existence based inlining
ssa Should SSA form be constructed on the HIR?
load_elimination Should we perform redundant load elimination during SSA pass?
coalesce_after_ssa Should we coalesce move instructions after leaving SSA?
expression_folding Should we try to fold expressions with constants in SSA form?
live_range_splitting Split live ranges using LIR SSA pass?
gcp Perform global code placement
gcse Perform global code placement
verbose_gcp Perform noisy global code placement
licm_ignore_pei Assume PEIs do not throw or state is not observable
turn_whiles_into_until Turn whiles into untils
loop_versioning Loop versioning
handler_liveness Store liveness for handlers to improve dependence graph at PEIs
schedule_prepass Perform prepass instruction scheduling
no_checkcast Should all checkcast operations be (unsafely) eliminated?
no_checkstore Should all checkstore operations be (unsafely) eliminated?
no_bounds_check Should all bounds check operations be (unsafely) eliminated?
no_null_check Should all null check operations be (unsafely) eliminated?
no_synchro Should all synchronization operations be (unsafely) eliminated?
no_threads Should all yield points be (unsafely) eliminated?
no_cache_flush Should cache flush instructions (PowerPC SYNC/ISYNC) be omitted? NOTE: Cannot be correctly changed via the command line!
reads_kill Should we constrain optimizations by enforcing reads-kill?
monitor_nop Should we treat all monitorenter/monitorexit bytecodes as nops?
static_stats Should we dump out compile-time statistics for basic blocks?
code_patch_nop Should all patch point be (unsafely) eliminated (at initial HIR)?
instrumentation_sampling Perform code transformation to sample instrumentation code.
no_duplication When performing inst. sampling, should it be done without duplicating code?
processor_specific_counter Should there be one CBS counter per processor for SMP performance?
remove_yp_from_checking Should yieldpoints be removed from the checking code (requires finite sample interval).

Value options.

Option Description
ic_max_target_size Static inlining heuristic: Upper bound on callee size
ic_max_inline_depth Static inlining heuristic: Upper bound on depth of inlining
ic_max_always_inline_target_size Static inlining heuristic: Always inline callees of this size or smaller
ic_massive_method_size Static inlining heuristic: If root method is already this big, then only inline trivial methods
ai_max_target_size Adaptive inlining heuristic: Upper bound on callee size
ai_min_callsite_fraction Adaptive inlining heuristc: Minimum fraction of callsite distribution for guarded inlining of a callee
edge_count_input_file Input file of edge counter profile data
inling_guard Selection of guard mechanism for inlined virtual calls that cannot be statically bound
fp_mode Selection of strictness level for floating point computations
exclude Exclude methods from being opt compiled
unroll_log

Unroll loops. Duplicates the loop body 2^n times.
cond_move_cutoff How many extra instructions will we insert in order to remove a conditional branch?
load_elimination_rounds How many rounds of redundant load elimination will we attempt?
alloc_advice_sites Read allocation advice attributes for all classes from this file
frequency_strategy How to compute block and edge frequencies?
spill_cost_estimate Selection of spilling heuristic
infrequent_threshold Cumulative threshold which defines the set of infrequent basic blocks

cbs_hotness Threshold at which a conditional branch is considered to be skewed
ir_print_level

Only print IR compiled above this level

Adaptive System Non-Standard Command-Line Options

Boolean options

Option Description
enable_recompilation 

Should the adaptive system recompile hot methods?
enable_advice_generation Do we need to generate advice file?
enable_precompile Should the adaptive system precompile all methods given in the advice file before the user thread is started?
enable_replay_compile Should the adaptive system use the pseudo-adaptive system that solely relies on the advice file?
gather_profile_data Should profile data be gathered and reported at the end of the run?
adaptive_inling Should we use adaptive feedback-directed inlining?
early_exit Should AOS exit when the controller clock reaches early_exit_value?
osr_promotion Should AOS promote baseline-compiled methods to opt?
background_recompilation Should recompilation be done on a background thread or on next invocation?
insert_yieldpoint_counters Insert instrumentation in opt recompiled code to count yieldpoints executed?
insert_method_counters_opt Insert intrusive method counters in opt recompiled code?
insert_instruction_counters Insert counters on all instructions in opt recompiled code?
insert_debugging_counters Enable easy insertion of (debugging) counters in opt recompiled code.
report_interrupt_stats

Report stats related to timer interrupts and AOS listeners on exit.
disable_recompile_all_methods

Disable the ability for an app to request all methods to be recompiled.

Value options

Option Description
method_sample_size

How many timer ticks of method samples to take before reporting method hotness to controller.
initial_compiler

Selection of initial compiler.
recompilation_strategy Selection of mechanism for identifying methods for optimizing recompilation.
method_listener_trigger What triggers us to take a method sample?

call_graph_listener_trigger What triggers us to take a method sample?
logfile_name 

Name of log file.
compilation_advice_file_output

Name of advice file.

dynamic_call_file_output Name of dynamic call graph file.
compiler_dna_file Name of compiler DNA file (no name ==> use default DNA).  Discussed in a comment at the head of VM_CompilerDNA.java.
compiler_advice_file_input File containing information about the methods to Opt compile.
dynamic_call_file_input File containing information about the hot call sites.
logging_level Control amount of event logging (larger ==> more).
final_report_level Control amount of info reported on exit (larger ==> more).
decay_frequency After how many clock ticks should we decay.
dcg_decay_rate What factor should we decay call graph edges hotness by.
dcg_sample_size After how many timer interrupts do we update the weights in the dynamic call graph?
ai_seed_multipiler  

Initial edge weight of call graph is set to ai_seed_multipler * (1/ai_control_point).
offline_inline_plan_name Name of offline inline plan to be read and used for inlining.
early_exit_time Value of controller clock at which AOS should exit if early_exit is true.
invocation_count_threshold Invocation count at which a baseline compiled method should be recompiled.
invocation_count_opt_level Opt level for recompilation in invocation count based system.
counter_based_sample_interval What is the sample interval for counter-based sampling.
ai_hot_callsite_threshold

What percentage of the total weight of the dcg demarcates warm/hot edges.
max_opt_level The maximum optimization level to enable.

Virtual Machine Non-Standard Command-Line Options

Boolean Options

Option Description

measureCompilation

Time all compilations and report on exit.
measureCompilationPhases

Time all compilation sub-phases and report on exit.

stackTraceFull

Stack traces to consist of VM and application frames.

stackTraceAtExit Dump a stack trace (via VM.syswrite) upon exit.
verboseTraceClassLoading More detailed tracing then -verbose:class.
errorsFatal Exit when non-fatal errors are detected; used for regression testing.

 Value options

Option Description
maxSystemTroubleRecursionDepth

If we get deeper than this in one of the System Trouble functions, try to die.
interruptQuantum Timer interrupt scheduling quantum in ms.
schedulingMultiplier

Scheduling quantum = interruptQuantum * schedulingMultiplier.
traceThreadScheduling

Trace actions taken by thread scheduling.
verboseStackTracePeriod Trace every nth time a stack trace is created.

edgeCounterFile

Input file of edge counter profile data.

CBSCallSamplesPerTick

How many CBS call samples (Prologue/Epilogue) should we take per time tick.
CBSCallSampleStride Stride between each CBS call sample (Prologue/Epilogue) within a sampling window.

CBSMethodSamplesPerTick How many CBS method samples (any yieldpoint) should we take per time tick.

CBSMethodSampleStride

Stride between each CBS method sample (any yieldpoint) within a sampling window.



Running Jikes RVM with valgrind

 Jikes RVM can run under valgrind, as of SVN revision 6791 (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.

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> ...

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.