HeapStats/Analyzer-version2

From IcedTea

Jump to: navigation, search
[HeapStats User Manual Table of contents]

This page is the online manual about HeapStats 2.x analyzer. If you want to read the HeapStats 1.x manual, go to HeapStats/Analyzer-version1

Contents

1 Introduction

HeapStats Analyzer (hereinafter Analyzer) is a visualizing tool for Java runtime information in Java applications. Analyzer views graphical information of Java's garbage collection (GC) and allocated objects in the heap. Analyzer also allows you to export the data in CSV (comma separated values) text file format, which may be easily retrieved the status of your application by detailed processing and analysis.

2 Start HeapStats Analyzer

2.1 Log Data Pane

  1. Click the "Log file" button to display the "Select log files" popup window, in order to select the log file collected by the HeapStats Agent (hereinafter Agent).
  2. Select the log file (e.g. heapstats_log.csv) which you want to display. If you select multiple files with pressing "shift" or "ctrl" key, Analyzer parses all files.
  3. Select a duration which you want to view log data by "Range".
  4. Click the "OK" button to load log data. It will take time to analyze if your data set is very large.

2.2 SnapShot Data Pane

  1. Click the "SnapShot" button to display the "Select SnapShot files" popup window, in order to select the data files created by Agent.
  2. Select the data files (e.g. heapstat_snapshot.dat) you want to analyze. If you select multiple files with pressing "shift" or "ctrl" key, Analyzer parses all files like log data.
  3. Select a duration which you want to view log data by "Range".
  4. Select either "HeapSize" or "Instance" at "DataFormat" radio button, to select the data format of "Histogram Tab" and "SnapShot Data Tab".
  5. Click the "OK" button to load snapshot data. It will take time to analyze if your data set is very large.

2.3 Thread Recorder Pane

  1. Select "Thread Recorder" tab.
  2. Click "File" button and choose thread recorder file (*.htr) .
  3. Select time range.
  4. Click "OK" button.

2.4 JVMLive Pane

  1. You should open the below port(s) at firewall on your OS (*)
    • JDP
      • Multicast address: -Dcom.sun.management.jdp.address : default value is 224.0.23.178
      • Port number: -Dcom.sun.management.jdp.port : default value is 7095(udp)
    • Error report server
      • Port number: -Derrorreport.server.port : default value is 4711(udp)
  2. Select JVMLive tab

(*)The command example for RHEL7/CentOS7

# firewall-cmd --permanent --zone=public --add-port=7095/udp
# firewall-cmd --permanent --zone=public --add-port=4711/udp
# firewall-cmd --reload
# firewall-cmd --zone=public --list-all

3 Log Data Pane

3.1 Resource Data Tab

Resource Data Tab displays the logs from Agent on the specified range of snapshots. These graphs display the following information.

Note: If you loaded snapshot which include result of multiple java processes, all graphs display yellow vertical lines to point the time when java processes restarted.

Java CPU
user: CPU time spent by the process to execute user-written code
system: CPU time spent by the process to execute system call
System CPU
user: CPU time spent on entire system executing user-written code
nice: CPU time spent on entire system executing user-written code which in low priority
idle: Idle CPU usage of entire system
I/O wait: I/O usage of entire system
IRQ: IRQ(Interrupt ReQuest) usage of entire system
soft IRQ: Software IRQ usage of entire system
steal: CPU steal usage being used by the virtual machines
guest: CPU usage being used for virtual guest</nowiki>
Java Memory
RSS(KB): The number of pages which are currently being used
VSZ(KB): Total size of memory the process occupies in virtual memory
Threads
The number of threads currently executing in Java application
Safepoint Count
Total count for which application threads were stopped
Safepoint Time
Total time(msec) for which application threads were stopped
Monitor Contention
The count of monitor have been executed to avoid race conditions in Java application
Table
Process reports which show the average and peak.
Average of CPU usage: The average CPU usage
Peak of CPU usage: The peak CPU usage
Average of VSZ: The average virtual memory usage
Peak of VSZ: The peak virtual memory usage
Average of RSS: The average physical memory usage
Peak of RSS: The peak physical memory usage
Average of live threads: The average live threads
Peak of live threads: The peak live threads


3.2 Log Detail Data Tab

Log Detail Data Tab displays the information from the fault analysis-related archive file, which collected and compiled by HeapStats Agent. The file was sorted the oldest dated events on top and latest at the bottom. If the archive file is not collected, the view does not display any information.

Select the time which you want to confirm the information by "Archive Time". Then, select "File Date" to display the detail in the bottom textarea as the following.

File Date
FileName: The name of current archive file displayed
envInfo.txt: JVM environmental information & kernel/libc information (see*1)
redhat-release: RedHat distributions information file (The filename is belong to the execution environment)
cmdline: Process parameter file
status: Process status file
smaps: Memory mapping data file
limits: Process resource limits file
Socket: Socket endpoint and owner information
ThreadDump: Thread dump data(only display deadlock detected by LogTrigger)
(*1) Parameter list of "envInfo.txt"
CollectionDate: Date of collected information(format: "yyyyMMDD HH:mm:ss")
LogTrigger: Trigger of collected logs(fault occurred/signal caught/deadlock detected)
VmVersion: Version information of virtual machine
OsRelease: OS Release Information
LibCVersion: Version information of libc
LibCRelease: Release Information of libc
VmName: Name of virtual machine
ClassPath: Path of class
EndorsedPath: Endorsed ClassPath
JavaVersion: Version information of Java
JavaHome: Path of JAVA_HOME
BootClassPath: Path of BootClassPath
VmArgs: Startup arguments for virtual machine
VmFlags: Startup flag for virtual machine
JavaCmd: Java Command-line options
VmTime: Startup time of virtual machine(msec)


4 Snapshot Pane

4.1 Summary Data Tab

Summary Data Tab displays statistical information on the specified range of snapshots. These table and graphs show information as the following.

Java Heap
Young: Usage heap of Young generation (a.k.a New generation)
Old: Usage heap of Old generation (a.k.a Tenure generation)
Free: Free heap (Total heap - Young - Old)
Note: You can change the stacked order by property (heaporder_bottom_young, see heapstats.properties file).
Instances
Total amount of instances of live objects
GC Time
Time of occurred GC (either Full GC or Scavenge GC) (msec)
Metaspace
The usage of Metaspace (JDK8 or later) or Permanent generation (JDK7 or older).
Table
SnapShot Count: Amount of taken snapshots
GC Count: Total GC Count (Full: Full GC Count, Young: Scavenge GC Count)
Latest Java heap usage: The latest heap usage of loaded snapshot
Latest Metaspace usage: The latest metaspace usage of loaded snapshot
Maximum GC Time: Maximum time of all GC
Max SnapShot size: Maximum size of snapshots
Max entry count:: Maximum count of entries

4.2 Histogram Tab

Histogram Tab displays the delta data of heap memory in use on the specified range of snapshots.

StackedAreaChart (Heap memory information)
It displays cumulative totals of heap usage per objects for the specified snapshots.
The number of objects contains each Top 5 heap usage objects (set by the default ranking graph level) and the rest of objects as a group. To change the numbers of objects, you can set up the ranking graph level from the "Option" menu.
If you select "HeapSize" at "Data Format" radio button, it displays the heap memory used in descending order.
If you select "Instance" at "Data Format" radio button, it displays the total number of instances in descending order.
Note: If you loaded snapshot which include result of multiple java processes, it displays yellow vertical lines to point the time when java processes restarted.
Table (Object list)
It displays the objects listed in descending order of the differences between the heap memory used by the objects from the Start snapshot to the End snapshot.

4.3 SnapShot Data Tab

SnapShot Data Tab displays the information of the specified snapshot. The data for the initial display is provided as the oldest snapshot from the source data file. To display a snapshot of the specified time which you want to see, you can select by the drop-down list on top-left.

These graphs display the following information.

SnapShot Information
Date: Date of the snapshot
Entries: Total number of the entries
Instances: Total number of the instances
Total Java Heap Usage: Total amount of the java heap usage
Total Metaspace Usage: Total amount of the metaspace usage
SnapShot Cause: Cause of snapshot (GC、DataDumpRequest、Interval)
GC Cause: GC Cause List (see*2)
GC time: GC time which occurred when this snapshot have taken
Heap Usage PieChart
It displays the heap usage per objects in a pie chart. The number of objects contains each Top 5 heap usage objects (set by the default ranking graph level) and the rest of objects as a group (Others).
Objects List
It displays all objects are allocated by heap memory when the snapshot is captured.
(*2) GC Cause List
System.gc(): GC is explicitly invoked by the Java application.
FullGCAlot: A large number of the Old generation GC (FullGC) occurs.
ScavengeAlot: A large number of the Young generation GC (Scavenge GC) occurs.
Allocation Profiler: GC is explicitly invoked by Allocation Profiler.
JvmtiEnv ForceGarbageCollection: GC is explicitly invoked by JavaTM Virtual Machine Tool Interface (JVM TI).
No GC: No GC occurs.
Allocation Failure: GC is triggered due to the total heap is filled.
GCLocker Initiated GC: GC is triggered when a JNI Critical section is released.
Heap Inspection Initiated GC: GC is invoked by the heap inspection tool.
Heap Dump Initiated GC: GC is triggered by the heap dump.
Tenured Generation Full: Full GC is triggered due to the Old Heap (Old Generation) is filled.
Permanent Generation Full: Full GC is triggered due to the Perm Heap (Permanent Generation) is filled.
CMS Generation Full: Full GC is triggered due to the CMS Generation is filled.
CMS Initial Mark: GC required when a concurrent collection cycle is started.
CMS Final Remark: GC required when the concurrent remark phase is finished.
Old Generation Expanded On Last Scavenge: Full GC required when the Old Heap (Old Generation) is expanded on last Scavenge GC.
Old Generation Too Full To Scavenge: Full GC required when the Old Heap (Old Generation) is too full during Scavenge GC.
Last ditch collection: GC required when the system is out of memory.
ILLEGAL VALUE - last gc cause - ILLEGAL VALUE: GC required when an illegal value occurred at the last GC.
unknown GCCause: GC required when an unknown GC cause occurred.

4.4 Reference Tree Tab

Reference Tree Tab displays the reference relationships from the specified object in its parent direction or its child direction.

To display a red ellipsoidal object on this screen, we must select one object from the Objects List in SnapShot Data Tab, and double-click it. To expand the reference relationships from the red ellipsoidal object or the rectangular objects, we must click them.

This tab provides the following display preferences on this screen.

  • Direction of Reference: It can turn the direction in which referenced from the red ellipse, parent direction or child direction.
  • Sort: It can sort the objects in the number of instances order or heap usage order.
  • Ranking: It can filter the number of objects which are expanded in a single click.


5 Thread Recorder Pane

Thread Recorder tab shows Thread event data with timeline.

  • You can choose timeline with slider control. The control shows selected timeline with green area and label string.
  • Meanings of timeline color:
    • darkorange: Running
    • fuchsia: Monitor wait
    • limegreen: Monitor contention
    • lightskyblue: Sleep
    • mediumpurple: Park (Lock of sun.misc.Unpark)
    • gold: File write
    • forestgreen: File read
    • orangered: Socket write
    • olive: Socket read
    • darkgray: Fusion event
      • If event(s) is too short to show, Thread Recorder fuse them and set to this color.
  • CheckBox in left column is switch whether showing timeline.
    • If you want to review a part of threads, you can check and sort them.
    • This table view is sortable. So you can move threads which you checked to above when you click table column header.


6 JVMLive Pane

JVMLive provides four features:

  1. Lookup JVMs through JDP (Java Discovery Protocol)
    • JVMLive catches JDP multicast packets. If java processes which are set JDP appear on network, JVMLive lists them to "JVM list" view.
    • If you want to active JDP, you have to add Java options as below:
      • -Dcom.sun.management.jmxremote.port=<JMX port>
      • -Dcom.sun.management.jmxremote.authenticate=<true|false>
      • -Dcom.sun.management.jmxremote.ssl=<true|false>
      • -Dcom.sun.management.jmxremote.autodiscovery=true
    • JDP packet will be sent at regular intervals. If JDP packet is stopped, color of process in JVM list view changes to orange.
  2. Access JMX MBean through JConsole
    • Click process in JVM list view, then details will be shown at right table view.
    • Click JMX URL.
      • If JVMLive works on JDK (not JRE), JVMLive will lookup JConsole and will invoke it with JMX URL. Access/Change configurations/operations at HeapStats 2.0 agent on live.
    • Click process in JVM list view.
    • Click HeapStats version string.
    • JMX dialog will be shown:
      • Invoke resource log button will sent request for taking resource log.
      • Invoke log archive button will sent request for taking log archive.
      • Invoke SnapShot button will sent request for taking SnapShot.
      • Get resource log button can save current resource log as local file.
      • Get SnapShot button can save current SnapShot file as local file.
    • "Current configuration" table shows current setting of HeapStats agent. If you change value(s) in it and push "Commit" button, it will apply to remote HeapStats agent.
  3. Detect JVM crash on time (OracleJDK only)
    • This feature works for OracleJDK with java options as below:
      • -XX:+TransmitErrorReport
      • -XX:ErrorReportServer=<address>:<port (4711 by default)>
    • If java process crashes with hs_err log, JVMLive can catch them and show error dialog. Error information is added Crash history table view, and you can save their hs_err log to local file.

7 Write to CSV

"Option -> Write to CSV" button on menu bar allows you to export CSV in two data formats as below.

Heap Usage
ALL: to export the heap usage per class from all snapshots of the source data file
Selected: to export the heap usage per class from Start snapshot to End snapshot specified by "Select Range"
GC Statistics
ALL: to export the statistical information of the snapshots from all snapshots of the source data file
Selected: to export the statistical information of the snapshots from the Start snapshot to the End snapshot specified by "Select Range

The following is the example of the column names in each of the fields in two data format.

Heap Usage
Tag, Name, YYYYMMDD hh:MM:ss_instances, YYYYMMDD hh:MM:ss_total size
GC Statistics
SnapShot Date, Full GC Count, Young GC Count, New Heap Usage, Old Heap Usage, Total Heap Size, GC Cause, GC Time

8 Filter

You can limit the number of classes in a view by using a filter option from the "Histogram Tab". There are two types of filters: "Exclude Filter" is to remove the specified package name of class, "Class Search" is to select the classes.

The filter settings will be in effect at the followings area.

  • Histogram Tab
  • SnapShot Data Tab
  • Write to CSV

8.1 Exclude Filter

Exlude Filter remove (ignore) the specified package name of the class as follows.

  1. Define the packages and their related classes as a XML file (see *3), before you apply a filter.
  2. Click the "Add Filter" to select the XML file.
  3. Select the XML file and click the "OK" button to load the file.
  4. To filter for specific filter names, use the check box list at "Hide" row. The list displays all filter names that are defined in the selected XML file.
  5. Click the "OK" button to apply the filter settings to take effect.
  6. Click the "Clear" button, if you want to disable the filter settings.

(*3) The following is an example of XML file for Class Filter.

 <?xml version="1.0" encoding="UTF-8"?>
 
 <filters>
   <filter name="[FilterName]">    <- define an unique name to display in the Filter Name list.
     <visible>true</visible>       <- true : allow to remove
     <classes>
       <name>java/io/File</name>   <- define the classpath (see '''''*4''''')
     </classes>
   </filter>
 </filters>

(*4) Class path entries can contain with an asterisk (*) wildcard. The wildcard is available for multiple path entries.

8.2 Class Search

Class Search selects the classes to limit the view.

  1. Enter the part or the whole of classpath, then a list below the textfield displays the results of the classpath are found from all objects.
  2. Select the classpath form the list. If you want to select more than one classpath, please press with the "shift" or "ctrl" button on your keyboard when you choose the classpath.
  3. Click "OK" button to apply the filter settings to take effect.
  4. Click the "Clear" button, if you want to disable the filter settings.


9 Language

Analyzer supports two languages for display in English or Japanese. You can specify the following argument in the "heapstats.properties" property. "en" is set the default language to English. "ja" is set the default language to Japanese.

English : language=en
Japanese: language=ja


10 Setting style of Class Path

You can specify the style of class path to Java type signatures, instead of the package names using their fully-qualified-class-name (FQCN). To set the style of class path to Java type signatures, specify the value of the following argument to "true" in the "heapstats.properties" property.

replace=true

The following table summarizes the encoding for the Java type signatures, which is the specification of the JNI.

Type Signature Java Type
B byte
C char
I int
S short
J long
D double
F float
V void
Z boolean
L fully-qualified-class; fully-qualified-class
[type] type[]
/ .


See Oracle's document for more information.

Personal tools