Popular Courses

Browse Our Free Resources

  • whitepapers
  • whitepapers
  • webinars
  • blogs

Our Locations

Training Centres

Vancouver, BC
Calgary, AB
Edmonton, AB
Toronto, ON
Ottawa, ON
Montreal, QC
Hunt Valley
Columbia

locations map

Calgary

550 6th Av SW
Suite 475
Calgary, AB
T2P 0S2

Toronto

821A Bloor Street West
Toronto, ON
M6G 1M1

Vancouver

409 Granville St
Suite 902
Vancouver, BC
V6C 1T2

U.S. Office

436 York Road
Suite 1
Jenkintown, PA
19046

Other Locations

Dallas, TX
Miami, FL

JDK 1.5 Heap Monitor

Web Age Solutions Inc.

Introduction

As a general rule of thumb, a Java application should not spend more than 10% of the time performing GC. The -verbosgc output of Sun JDK does not show the interval between GCs or keep statistical average of the time spent in doing GC.

That is where this JVMTI monitor comes into play. It is a high performance monitor that shows GC statistics in a simple to understand screen.

Download and Installation

The monitor is developed using the JVMTI API. It requires Java 1.5. It has been tested in Sun JDK 1.5 for Windows.

Download the DLL from here.

Copy the DLL in any folder that is in your PATH. For example, C:\WINNT.

How to Use the Monitor

To load the monitor, add the "-agentlib:hm" command line option to Java. For example:

java -agentlib:hm com.webage.Test

The statistics window will show up immediately.

It shows the following information.

  • Samples: The number of GCs used in the average calculations.
  • Avg duration: Average amount of time spent in GC in seconds. A small number is better.
  • Avg interval: Average interval between two GCs in seconds. A large number is better.
  • Percentage: Percetage of time spent in GC. It is calculated as (Avg duration x 100) / (Avg duration + Avg interval). This number should be well below 10%.
  • Last duration: Duration of the last GC.
  • Last interval: Interval between the last two GCs.

Click on the Reset button to clear the statistics. Usually, you should reset the statistics before every stress test run.

Defects

The duration numbers are a few nanoseconds more than what -verbosegc shows. This is possibly due to the JVMTI overhead. This difference is negligible.

This tool uses low level code and a defect can bring down the JVM. Test it thoroughly before deciding to use it in production. Please report any defect using the feedback form below.

Licensing

You are free to use this tool in any circumstances. There is no warranty of any kind. Web Age is not responsible for any damage of loss caused by this tool.