| United States-English |
|
|
|
![]() |
HPjmeter: User's Guide > Chapter 3 Getting StartedMonitoring Demonstration Instructions |
|
HPjmeter includes two sample applications that you can run to see live examples of a “memory leak” and a thread deadlock situation. You will be able to use the visualizers to examine data during the demonstration session. Here are the general steps for running the sample applications.
This sample application demonstrates how the memory leak alerts work in HPjmeter. The example uses a simple Java program, which allocates some objects, and uses a java.util.Vector object to retain references to some of the objects, thus exhibiting the behavior of a memory-leaking application. This application is configured to leak memory at the rate of about 10 MB per hour. The demo application is available from the HPjmeter installation directory: Source: $JMETER_HOME/demo/ML1.java Binary: $JMETER_HOME/demo/ML1.jar Use only the class name, ML1 with the run_simple_jvmagent script to start the sample. When measuring the sample applications, allow considerable time for the heap to mature and stabilize, and for the JVM agent to collect memory leak data. Eventually, you will see two alerts:
When using the default garbage collectors and heap size for HotSpot 1.4.2 JVM, the detection of a memory leak for this demonstration program occurs after about 20 minutes. This time can be substantially longer when using a different JVM or non-standard 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. Here is a memory leak alert for the sample program:
Here is the heap display for the sample program: See also Heap Usage Alert. This sample application demonstrates how HPjmeter detects deadlocked threads. The example creates pairs of threads every 30 seconds, stopping at 50 threads, which synchronize work using shared locks. Occasionally, the program reverses the order on which locks are taken, eventually causing a deadlock, which generates a Thread Deadlock Alert. The demo application is available from the HPjmeter installation directory: Source: $JMETER_HOME/demo/DL1.java Binary: $JMETER_HOME/demo/DL1.jar Use only the class name, DL1 with the run_simple_jvmagent script to start the sample. Use the Thread Histogram display to see the thread activity. Deadlocked threads show a solid red bar. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||