Rate This Document
Findability
Accuracy
Completeness
Readability

Viewing Hotspot Information

Prerequisites

A real-time profiling task has been created and is in progress.

Hotspot analysis refers to collecting stack information about CPU, CYCLES, LOCK, CACHE_MISSES and ALLOC events at certain points of time and collecting statistics on hotspot methods in the current JVM. Queries are performed in the form of an icicle graph.

Viewing Hotspots

  1. In the Task/Report List area of the Java Profiler page, click the name of the analysis task under Real-Time Profiling.

    The Overview tab page is displayed.

  2. Click the Hotspot tab.

    Select Hotspot from the top navigation menu, the Hotspot Function tab page is displayed by default. Click Create Hotspot Analysis to view the hotspot information. For details about the parameters, see Table 1.

    • If the server does not support hotspot analysis, the Create Hotspot Analysis button is dimmed. Tips about the reason of unavailability and method for using this function are given.
    • During startup, you can filter function methods that do not need analysis. If you specify methods that do not require analysis, you can click View Details to get more information.
    • Full-screen display is supported. You can click the corresponding graph to view the method details.
    • You can click Recreate Hotspot Analysis to re-create a hotspot analysis task.
    Figure 1 Creating a hotspot analysis task
    Table 1 Parameters for creating a hotspot analysis task

    Parameter

    Description

    Data Anti-interference

    The tool stops collecting dynamic data from the Overview, CPU, and GC tab pages to make hotspot analysis more accurate. This function is enabled by default.

    Sampling Mode

    Indicates whether to limit the sampling duration. The options are Specified duration (default) and Unlimited duration.

    Sampling Duration (s)

    Data sampling duration. This parameter is mandatory when Sampling Mode is set to Specified duration.

    Sampling Interval (ms)

    Interval between data samplings.

    Sampling Event Type

    Type of the sampled data. The default value is CPU. The options are:

    • CPU
    • CYCLES
    • LOCK
    • CACHE_MISSES
    • ALLOC

    Configure Stack Depth

    Configures the maximum stack depth during collection. This function is disabled by default.

    Maximum Collected Stack Depth

    Maximum stack depth of the sampled data. This parameter is mandatory when Configure Stack Depth is enabled. The default value is 16, and the value ranges from 1 to 2048.

    Disassembly/Bytecode Analysis

    Indicates whether to enable disassembly or bytecode analysis. This function is disabled by default. Enabling this function will increase the application performance overhead, which may affect the program performance. This parameter is available when Sampling Event Type is set to CPU, CYCLES, or CACHE_MISSES.

    Kernel Mode Analysis

    Indicates whether to enable kernel-mode invoking analysis. This function is disabled by default. This parameter is available when Sampling Event Type is set to CPU, CYCLES, or CACHE_MISSES.

    Method Without Analysis

    User specified data that does not need to be sampled.

    Method With Analysis

    Data that must be sampled.

    Trigger Analysis By

    Method that triggers the analysis. This parameter is available when Sampling Event Type is set to CPU, CYCLES, or CACHE_MISSES.

    End Analysis By

    Method that triggers the ending of the analysis. This parameter is available when Sampling Event Type is set to CPU, CYCLES, or CACHE_MISSES.

    Figure 2 Hotspot functions
    • You can select one of the following options from the Graph Type drop-down list:
      • Flame graph: displays the flame graph. When you hover the mouse pointer over a function block, the detailed information about the function is displayed.

        The Y axis indicates the call stack. Each layer represents a function. A deeper stack indicates a higher flame. The top is the function being executed, and its parent functions are below it. The x axis indicates the number of samples. The wider space a function occupies on the x axis, the more times the function is sampled (the longer the execution time is). Note that the X axis does not represent time. Instead, it represents all call stacks arranged in alphabetical order.

      • An inverted flame graph starts from the top of the stack and gradually traces back to the bottom of the stack. It aggregates the call stacks that have the same call method.
    • You can display the flame graph and reverse flame graph as needed: Click to flip the flame graph up and down; click to restore the flame graph to its initial status; click to sort the inverted flame graph data by function proportion; click to sort the inverted flame graph data by function name; click to view a graph in full screen; click to export the flame graph as an HTML file.
    • For the flame graph and reverse flame graph, a search box is provided for you to search for a method name. The target method name is marked in purple and its percentage in all stacks is displayed. You can click Clear to remove the purple mark and search result.
  3. Click the Method Calling tab.

    On the displayed page, click Create Method Calling Analysis to view the method calling information. See Figure 3. For details about the parameters, see Table 2.

    • When creating a task, you can click Add Class to select more methods to be analyzed. There is no upper limit on the number of methods that can be analyzed.
    • Association between the class and method is supported when inputting the class and methods.
    • During data analysis on the current tab page, the analysis tasks that need to be started by clicking the button on other tab pages (such as the I/O, Database, and Web tab pages) will stop. To view the analysis results on other tab pages, switch to that page and perform the analysis again.
    Figure 3 Creating a method calling analysis task
    Figure 4 Method calling analysis results
    Table 2 Parameters for creating a method calling analysis task

    Parameter

    Description

    Creating a method calling analysis task

    Class

    Name of the class to be analyzed.

    Method

    Name of the method to be analyzed.

    Add Class

    The button for adding more classes and methods to be analyzed.

    What to Exclude

    Classes and methods that are excluded from the analysis.

    Must Analyze

    Classes and methods that must be analyzed. Content that must be analyzed has higher priority than the content to be excluded.

    Maximum Collected Stack Depth

    Maximum stack depth for analysis. This restriction only applies to Java stacks.

    The value ranges from 1 to 64. The default value is 8.

    Analysis results

    Entry Information

    Names of classes and methods entered for the analysis.

    Serial Number

    Sorting order of analyzed classes and methods.

    Status

    Statuses of analyzed classes and methods.

    Instrumentation Details

    Instrumentation details of analyzed classes and methods.

    Click a specific method to view Calling Relationship Tree and Hotspot Statistics. You can click to switch between the two views.

    • You can click to export the current analysis report. If you export the report on a task that is being instrumented, the report may not include the call relationship tree and hotspot statistics.
    • You can click or to expand or collapse the content.
    • By default, data items are sorted in descending order of the total time consumed. Each blue data bar indicates the proportion of the data in the same column. The larger the data, the wider the data bar. The maximum width is equal to the cell width.
    Figure 5 Calling relationship tree
    Figure 6 Hotspot statistics