Apache Harmony is retired at the Apache Software Foundation since Nov 16, 2011.

The information on these pages may be out of date, or may refer to resources that have moved or have been made read-only.
For more information please refer to the Apache Attic

Guide to Execution Manager Configuration

  1. What is EM?
  2. EM Configuration File
  3. EM Tracing Options
  4. More EM Configuration Samples

What is EM?

Execution Manager (EM) is a component in DRLVM that controls profile collection and recompilation processes.
For detailed information on EM, see the Execution Manager Component Description.

EM Configuration File

The set of JIT compilers and profile collectors used at run time and their relations is stored in the EM configuration file. During the VM initialization phase, EM uses hard-coded configuration or reads it from the config file, if specified.

You can use the following command-line option to make EM read its configuration from the file:

-Xem:<path to configuration file>
-Dem.properties=<configuration.file.path>

The following is a line-by-line description of the default EM configuration. These configuration settings can be used as a prototype to create new custom EM configuration files. The default configuration is:

chains=chain1,chain2

chain1.jits=JET_CLINIT
chain2.jits=JET_DPGO,OPT

chain1.filter=+::<clinit>
chain1.filter=-

JET_CLINIT.file=<path to dll>
JET_DPGO.file=<path to dll>
OPT.file=<path to dll>

JET_DPGO.genProfile=JET_DPGO_PROFILE
JET_DPGO_PROFILE.profilerType=ENTRY_BACKEDGE_PROFILER
OPT.useProfile=JET_DPGO_PROFILE

JET_DPGO_PROFILE. mode=SYNC
JET_DPGO_PROFILE.entryThreshold=10000
JET_DPGO_PROFILE.backedgeThreshold=100000

A line-by-line description of the settings follows.

chains=chain1,chain2

Every EM configuration file must define the chains property to indicate sequences of JIT compilers to be used to compile and/or recompile a method. In this example, two recompilation chains are set for the system: chain1 and chain2. EM analyzes chains until it has chosen the chain for the method.

chain1.jits=JET_CLINIT
chain2.jits=JET_DPGO,OPT

In this case, chain1 has one JIT compiler JET_CLINIT, and chain2 has two compilers: JET_DPGO and OPT. Using these JIT names, EM reads JIT-specific configuration and passes the names to JIT instances during initialization. A compiler instance can use its name to distinguish between its own properties and those of other JITs.

Note

Jitrino, the current default DRLVM JIT compiler, selects Jitrino.JET (fast, non-optimizing compiler) if the name starts with the JET prefix. Otherwise, the JIT instance is treated as Jitrino.OPT.

chain1.filter=+::<clinit> 
chain1.filter=-

Method filters are used to select methods that will be compiled by the first JIT in a chain. In this example, the first line configures chain1 to accept all <clinits> methods and the second line - to refuse to compile all other methods

The order of filters for every chain is significant. Chain filters can be considered as if-else clauses:
If a filter matches a method, EM stops examining other filters and analyzes the first sign in the filter:

If no filter has matched the compilation request, EM considers that the method is accepted to be compiled by the chain. Here is a format of all currently supported method filters.

Filter Type Filter Format Filter Examples
Name filter <class-name>::<method_name><signature> '- rejects all methods.
' '+java/lang' accepts all methods from the .java/lang package.
'+java/lang/Thread::s' accepts all methods of java.lang.Thread that starts with the letter 's'.
Size filter NUMB or NUM1B..NUM2B '+10B..100B' accepts all methods of bytecode size in range of [10..100].
'-20B' rejects all methods of bytecode size equal to 20.
Compile-num filter NUM or NUM..NUM '+1..1000' accepts all methods from 1 to 1000 (inclusive).
'-800' rejects to compile method that is compiled by number 800.

Note

The sequential method number could be changed from run to run in multithreaded environments.

JET_CLINIT.file=<path to dll>
JET_DPGO.file=<path to dll>
OPT.file=<path to dll>

For every JIT, the configuration file must define the location of the library file location. Multiple JIT compilers can be associated with the same library. For example, all paths can point to the same jit.dll file.

JET_DPGO.genProfile=JET_DPGO_PROFILE
JET_DPGO_PROFILE.profilerType=ENTRY_BACKEDGE_PROFILER
OPT.useProfile=JET_DPGO_PROFILE

These settings define profile collection and recompilation event configuration for two JIT compilers: JET_DPGO and OPT. The first line configures JET_DPGO to generate a profile JET_DPGO_PROFILE, with the type of associated profile collector specified in the second line. ENTRY_BACKEDGE_PROFILER is the built-in DRL EM profile collector type. In the third line, the OPT compiler is configured to use the new profile. After reading these configuration settings, the execution manager does the following:

  1. Instantiates the profile collector of the type ENTRY_BACKEDGE_PROFILER.
  2. Checks whether the JET_DPGO JIT can generate method profiles of this type; if so, requests the JIT to enable profile generation.
  3. Checks whether the OPT JIT can use method profiles of this type.
  4. Registers the profile collector as active.
JET_DPGO_PROFILE. mode=SYNC
JET_DPGO_PROFILE.entryThreshold=10000
JET_DPGO_PROFILE.backedgeThreshold=100000

The last four lines contain the configuration of the JET_DPGO_PROFILE profiler. These properties are specific for every profile collector type. The first option runs entry-backedge profile mode in the SYNC mode: counters check is done during the code execution. Use ASYNC to run counters checking in a separate thread. The last 2 options set the profile readiness threshold. Once the profile is ready, EM dispatches the method for recompilation with the next JIT in the current chain.

EM Tracing Options

Use the following command-line options to trace EM events:

Example

For the default EM configuration file, -verbose:em.OPTdumps all methods names that are compiled with Jitrino.OPT. According to the configuration details, these methods are hot methods.
Alternatively, you can get almost the same information by using the following: -verbose:em.profiler.JET_DPGO_PROFILE additionally dumps information about hot method profiles.

Examples of output:

C:\tools\decapo>c:\tools\harmony0706\bin\java.exe  -verbose:em.OPT -jar dacapo-beta051009.jar xalan
EM: recompile start:[OPT n=1] java/io/ByteArrayOutputStream::write(I)V
EM: recompile done:[OPT n=1] java/io/ByteArrayOutputStream::write(I)V
EM: recompile start:[OPT n=2] java/lang/String::hashCode()I
EM: recompile done:[OPT n=2] java/lang/String::hashCode()I
...
C:\tools\decapo>c:\tools\harmony0706\bin\java.exe  -verbose:em.profiler.JET_DPGO_PROFILE -jar dacapo-beta051009.jar xalan
EM: entry-backedge profiler intialized: JET_DPGO_PROFILE entry threshold:10000 backedge threshold:100000 mode:SYNC
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/io/ByteArrayOutputStream::write(I)V
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:59575] java/lang/String::hashCode()I
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/lang/String::length()I
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/lang/String::charAt(I)C
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/nio/charset/Charset::isLetter(C)Z
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/nio/charset/Charset::isDigit(C)Z
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/nio/Buffer::remaining()I
EM: profiler[JET_DPGO_PROFILE] profile is ready [e:10000 b:0] java/util/HashMap::getModuloHash(Ljava/lang/Object;)I
...  

More EM Configuration Samples

DRLVM has several EM configurations supplied in the following files: client.emconf (the default), opt.emconf, jet.emconf, server.emconf and server_static.emconf.
The -Xem:opt, -Xem:jet and -Xem:server_static configurations are almost identical and rely on the Jitrino JIT naming convention. This way, any JIT instance with the JET prefix in the name is a Jitrino.JET instance.
Another difference in these configurations are options passed to the JIT compiler.

These configurations have only one JIT and no profile collection or recompilation.

-Xem:jet - the baseline compiler mode configuration

chains=chain1
chain1.jits=JET
JET.file=<path to dll>

-Xem:opt - the client-static mode configuration

chains=chain1
chain1.jits=CS_OPT
OPT.file=<path to dll>

-Xem:server_static - the server-static mode configuration

chains=chain1
chain1.jits=SS_OPT
OPT.file=<path to dll>

These configurations use recompilation and collect profiles.

-Xem:client - the default configuration, or client dynamic

chains=chain1,chain2
chain1.jits=JET_CLINIT
chain2.jits=JET_DPGO,CD_OPT


# JET_CLINIT compiles only <clinit> methods, all other methods compiled with JET_DPGO 
# which does entry/backedge instrumentation

chain1.filter=+::<clinit>
chain1.filter=-

JET_CLINIT.file=<path to dll>
JET_DPGO.file=<path to dll>
CD_OPT.file=<path to dll>

#Configuration of profile collector and recompilation
JET_DPGO.genProfile=EB_PROF
EB_PROF.profilerType=EB_PROFILER
CD_OPT.useProfile=EB_PROF


EB_PROF.mode=SYNC
EB_PROF.entryThreshold=10000
EB_PROF.backedgeThreshold=100000

-Xem:server - the server mode configuration, or server dynamic

chains=chain1,chain2
chain1.jits=JET_CLINIT
chain2.jits=SD1_OPT,SD2_OPT

chain1.filter=+::<clinit>
chain1.filter=-

JET_CLINIT.file=<path to dll>
SD1_OPT.file=<path to dll>
SD2_OPT.file=<path to dll>

# Edge profiler and recompilation parameters
EDGE_PROF.profilerType=EDGE_PROFILER
EDGE_PROF.entryThreshold=40000
EDGE_PROF.backedgeThreshold=150000
EDGE_PROF.tbsTimeout=10
EDGE_PROF.tbsInitialTimeout=0

SD1_OPT.genProfile=EDGE_PROF
SD2_OPT.useProfile=EDGE_PROF

Note

To run VM in the intereter mode, use the -Xint command-line option to override any other EM settings. Currently, DRLVM does not support the mixed mode of the JIT compiler plus interpreter.

Back to top