Sun Microsystems Logo
First Previous Next Last Overview
 

LAB-1205: Java Application Performance Analysis

Exercise 22: Demonstrate capturing the verbose gc log

Learning goals of this exercise

In this exercise you will learn:

Background for this exercise

Please see Exercise 1 for an overview of running the javaperf GUI launcher.

There is a great deal more data that we can get from the JVM.  The jvmstat tools are perhaps the most recent technique.  There are other kinds of logging information available too, such as -verbose:gc as documented on the Java launcher page.

In this exercise you will see how to capture the verbose GC log.

Steps to follow

  1. For this exercise we've added some additional logging options.
    The JAVAPERF_HOME/conf/exer22.properties file contains:
    # javaperf hands-on lab properties for an exercise
    exer.jar=${demo.home}/jfc/Java2D/Java2Demo.jar
    exer.logs=${javaperf.logs}/exer${exer.num}
    exer.log=${exer.logs}/Java2Demo.log
    exer.name=${exer.num}: Demonstrate capturing the verbose gc log
    exer.compiler=
    exer.heap=-XX:NewSize=4m -XX:MaxNewSize=4m -Xms16m -Xmx16m
    exer.gc=-XX:+DisableExplicitGC
    verbose.log=${exer.logs}/verbose-gc.log
    exer.other=-verbose:gc -XX:+PrintGCTimeStamps -Xloggc:${verbose.log}
            

  2. Click [Start]. You will see the Java 2D Demo application start...

  3. Quit the Java 2D Demo application by clicking [Stop]

  4. Now check out the verbose gc log by expanding the "Log files" node in the JTree: [Exercise22-VerboseGCLog]

Summary

There are several tools to help diagnose what is going on inside the JVM and how your application is behaving.
The verbose GC log is a classic log that can be useful by itself to see how much memory is collected and it is often used by other other tools to generate summaries and/or graphs of GC behavior.

Next Steps

Congratulations!!! 

You have completed the "LAB-1205 Java Application Performance Analysis" Hands-on Lab. 
Please let us know what you think of this lab by sending a note to handsonlab06-javaperf@yahoogroups.com