| United States-English |
|
|
|
![]() |
Java™ Troubleshooting Guide for HP-UX Systems: > Chapter 1 Diagnostic and Monitoring Tools and OptionsAllocation Site Statistics and Zero Preparation Xverbosegc |
|
For Java applications started without -Xverbosegc, you can prompt the Java Virtual Machine (JVM) to emit HP Xverbosegc information by sending the running Java program a SIGPROF signal. For example, assume the running Java process ID is 6754. Executing either of the two actions listed below prompts the JVM to start emitting detailed HP Xverbosegc information:
Issuing a second SIGPROF signal to the running Java program prompts the JVM to stop emitting the Xverbosegc information. Similarly, issuing yet another SIGPROF signal to the running process prompts the JVM to start issuing Xverbosegc information one more time. Additionally, and only if you had started the Java application with -XX:+PrintAllocStatistics, when zero preparation Xverbosegc is enabled as specified in the previous paragraph, the JVM also emits detailed allocation site statistics. If you start your application with -XX:+PrintAllocStatistics, and if you do not specify -Xverbosegc, or send the running process a SIGPROF signal, then the JVM emits allocation site statistics to standard out when the application terminates. (That is, when the Java process stops running.) If you do not want to wait for the application to terminate, or if the application is designed to be long running (or does not terminate), then you can obtain allocation site statistics by sending the running Java program a SIGPROF as described above. Unlike Xverbosegc information emission in zero preparation mode, which is started with a SIGPROF and stopped with a second SIGPROF, when -XX:+PrintAllocStatistics is specified, allocation site statistics are emitted every time the JVM receives a SIGPROF. When -XX:+PrintAllocStatistics is specified along with -Xverbosegc, allocation site statistics data are directed to the same output specified for HP Xverbosegc. If no output file is specified, allocation site statistics are directed to standard out (to the terminal where the program was started from). When -XX:+PrintAllocStatistics is specified alone (without -Xverbosegc on the command line), allocation site statistics are directed to standard out (to the terminal). When a SIGPROF signal is sent to a running Java process that was originally started with -XX:+PrintAllocStatistics on the command line, the SIGPROF signal also enables Xverbosegc data collection if Xverbosegc was not specified on the command line when the program was started. The output of both Xverbosegc and allocation site statistics is directed to a file created for you by the JVM. The name of the file created by the JVM has the following format: java_<pid>.vgc. Where <pid> is the Java process ID. The following table lists all possible permutations and corresponding locations of emitted data for both allocation site statistics and zero preparation Xverbosegc. Table 1-17 Actions, JVM Options Specified, and Allocation Site Statistics Data Locations
Sending multiple SIGPROF signals to a running Java process produces multiple allocation site statistics dumps and the JVM dumps the buffered data immediately after the SIGPROF is received. Allocation site statistics counters inside the JVM are reset after each SIGPROF induced the dump of the data. HPjmeter consolidates data from multiple allocation site statistics dumps into one report that is presented in a new tab in the Xverbosegc data visualizer. Allocation sites can originate from interpreted as well as compiled Java code when specifying -XX:+PrintAllocStatistics, and only allocations coming from compiled code are reported. The JVM detects and compiles the application’s (and JDK's) most active Java methods as early as possible. Though reporting allocation sites originating from compiled code is only incomplete from a comprehensive reporting point of view, it does always report the most active allocation sites (the sites most likely to cause GC performance problems). In the following example, the default sort on the table is determined by % Allocated, meaning the percent of memory allocated to the objects generated by the compiled portion of the running Java application. The values in this column are displayed in descending order, from greatest area of memory use to the least. Making code changes first in the area where memory use is greatest can have more significant impact on the heap. For more details about Allocation Site Statistics in HPjmeter, see the HPjmeter User's Guide at http://docs.hp.com/en/dev.html#Java. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||