HP (Hewlett-Packard) 5992-1918 ユーザーズマニュアル

ページ / 78
1.7.2.5.1 Sample Memory Leak Application
This application demonstrates how memory leak alerts work in HPjmeter. It uses a simple
program which allocates some objects. The program uses a java.util.Vector object to retain
references to some of the objects. This application is configured to leak memory at the rate of
about 10 MB per hour. It is available from the HPjmeter installation directory:
Source: $JMETER_HOME/demo/ML1.java
Binary: $JMETER_HOME/demo/ML1.jar 
Use the class name ML1 with the run_simple_jvmagent script to start the sample. When
measuring the sample application, allow considerable time for the heap to mature and stabilize,
and for the Java VM agent to collect memory leak data. Eventually, you will see the following
two alerts:
Expected OutOfMemory Error Alert with the leaking rate
Memory Leak Locations Alert with the leak location
When using the default garbage collectors and heap size for SDK 1.4.2, the detection of a memory
leak for this demonstration program occurs after about 20 minutes. This time may be substantially
longer when using a different Java VM or nonstandard garbage collector or heap settings. In real
situations, the detection time depends on the maximum heap size, the size of the leak, the
application running time, and the application and load characteristics. Typically, the detection
will occur in about one hour.
Following is a memory leak alert for the sample program:
Figure 1-12 HPjmeter - Memory Leak Alert
Following is the heap display:
1.7 HPjmeter
33