Tools Home

Java Lock Monitor (JLM)




General Description


 
Back to TOP
 

General Description

JLM provides monitor hold time accounting and contention statistics on monitors used in Java applications and the JVM itself. Functionality provided includes:
 

Time and time units

Time (as in hold time) is accounted for in units of cycles on all x86 platforms.
 

Supported Java Versions and Platforms

JLM is shipped as part of the IBM Runtime Environment for Linux, v1.4.0 and above.
 
Back to TOP
 

Usage Instructions

The best way to describe how to use JLM is via an example. The following assumptions are made:

Our example executes a Java application, called "HelloWorld".

  1. Start the Java application with the required command options
  2. Start rtdriver
  3. To start collecting JLM data enter one of the following commands at the rtdriver command prompt:
        jlmstart (collect counters and monitor hold times), or
        jlmlitestart (collect counters only)
  4. To dump JLM data enter jlmdump at the rtdriver command prompt.

    JLM dump files are named log-jlm.#_pppp where # is a sequence number, starting with 1 (one) for the first jlmdump and incrementing by one for each subsequent jlmdump, and pppp is the PID (process id) of the Java process. The files are located in the Java current working directory (i.e. the directory from where Java was started).

  5. To stop (turn off) JLM data collection enter jlmstop at the rtdriver command prompt.

 
Back to TOP
 

JLM Reported Statistics Description

The following descriptions refer to this sample JLM output file produced by JProf.

Example of contention on one monitor

KEY:
         - work (thread is busy)
         | request lock
         > lock ownership granted
         ~ thread holds lock
         < thread releases lock
         * thread waiting to be granted ownership
Thread 1:   -----|>~~~~~~~~~~~~~~~~~~~~~~~~~~~<-----------------------------
Thread 2:   ------------|**********************>~~~~~~~~~~~~<---------------
Thread 3:   ------------------|******************************>~~~~~~<-------
Thread 4:   ----------------------|**********************************>~~~<--
       Hold time: |<------------------------->|
       Thread 1
                                               |<---------->|               Thread 2
                                                             |<---->|       Thread 3
                                                                     |<->|  Thread 4


Background

A monitor can be acquired in one of two ways:


Fields in the report






Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
IBM is a trademark of International Business Machines Corporation in the United States, other countries, or both
Other company, product or service names may be trademarks or service marks of others.
MMX, Pentium, and ProShare are trademarks or registered trademarks of Intel Corporation in the United States, other countries, or both.

Tools home ]