|
|
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
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}
|
. You will see the Java 2D Demo application start...
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
This lab documentation is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.