Skip to content

Profiling


Profiling continuously samples and collects data on the runtime status of applications in terms of CPU, memory, I/O, and other aspects, automatically obtaining performance profiling data. The collected data is visualized in real-time through flame graphs, clearly displaying the call stack relationships and resource consumption ratios between each method, class, and thread, helping developers identify hot functions and efficiency bottlenecks, and providing data support for code-level performance optimization.

In the Profiling Explorer, you can:

  • Analyze runtime dynamic performance data of applications in different languages such as Java, Python, Go, and C/C++ based on flame graphs, intuitively locating performance issues caused by inefficient algorithms, memory leaks, or improper I/O operations.

  • By associating with Traces, obtain the code execution fragments corresponding to specific business requests (Spans), achieving end-to-end performance tracking from business interfaces to specific methods, and precisely identifying optimization directions.

Prerequisites

  1. Install DataKit.
  2. Enable the Profiling Collector.

After Profiling data is reported, you can query and analyze it through the Explorer, supporting operations such as search filtering, quick filtering, column customization, and data export.

Note

Profiling data is retained for 7 days by default.

Profiling Details Page

Performance

On the details page, you automatically enter the "Performance" tab, which includes attribute tags, performance flame graphs, and runtime information.

Flame Graph

The core of Profiling is using flame graphs for code-level performance analysis. Flame graphs visually display the execution time or resource consumption distribution of each method in the call stack. The system also provides aggregated data analysis views based on multiple dimensions such as methods, libraries, and threads, directly listing the hotspot methods with the highest execution proportion, helping to quickly focus on core performance issues.

Analytical capabilities support multiple programming languages, and the observable metric dimensions vary for different languages. For example:

Category Description
CPU Time The running time of each method on the CPU
Wall Time The elapsed time spent by each method, including the time running on the CPU, waiting for I/O, and any other activities that occurred during the method's runtime
Heap Live Size The amount of heap memory still in use
Allocated Memory The amount of heap memory allocated by each method, including allocations that were later freed
Allocations The number of heap allocations made by each method, including allocations that were later freed
Thrown Exceptions The number of exceptions thrown by each method
Lock Wait Time The time each function spent waiting for a lock
Locked Time The time each function held a lock
Lock Acquires The number of times each method acquired a lock
Lock Releases The number of times each method released a lock

|

Category

    | Description     |
| --------------- | -------- |
| CPU Time                 | The running time of each method on the CPU, including the service's Java bytecode and runtime operation time, excluding time spent in native code called through the JVM |
| Wall Time in Native Code | The number of samples in native code. Sampling may occur when the code is running on the CPU, waiting for I/O, or any other situation during method runtime. This does not include Java bytecode calls involved in running application code |
| Allocations              | The number of heap allocations made by each method, including allocations that were later freed             |
| Allocated Memory         | The amount of heap memory allocated by each method, including allocations that were later freed             |
| Heap Live Objects        | The number of live objects allocated by each method                             |
| Thrown Exceptions        | The number of exceptions thrown by each method                                     |
| Lock Wait Time           | The time each method spent waiting for a lock                                       |
| Lock Acquires            | The number of times each method acquired a lock                                       |
| File I/O Time            | The time each method spent on file reading and writing                          |
| File I/O Written         | The amount of data written to files by each method                             |
| File I/O Read            | The amount of data read from files by each method                           |
| Socket I/O Read Time     | The time each method spent reading from sockets                         |
| Socket I/O Write Time    | The time each method spent writing to sockets                          |
| Socket I/O Read          | The amount of data read from sockets by each method                         |
| Socket I/O Written       | The amount of data written to sockets by each method                         |
| Synchronization          | The time each method spent on synchronization                                  |

Quick Actions

  • Search: In the Type selection box, enter a method name keyword for fuzzy search, and directly select from the matching results to quickly locate and focus on a specific method.
  • Copy: Under Dimensions, hover to copy and view method details.
  • Click to Select: The Dimensions list displays all methods by default. Click on any method, and the flame graph will focus on displaying the call path of that method. Multiple selections are supported to compare the execution of multiple methods. Click the selected method again to deselect and restore the panoramic view.

Runtime Information

On the Runtime Information tab, you can view associated fields and tag attributes of the corresponding programming language runtime, including process parameters, environment variables, and system tags. You can add any tag as a filter condition to the Explorer list panel to quickly filter related data. You can also directly copy the tag content for use in associated queries in Logs or Traces.

Trace Association with Profiling

When both APM Trace and Profiling collection are enabled for an application, the system supports associating performance profiling data at the Trace level. In the Trace Details Page of APM, select any Span on the flame graph to view the list of associated code method calls and their Wall Time consumption ratio during the execution period of that business request.

This enables穿透式 analysis from a slow business request directly to specific time-consuming methods, and supports one-click navigation to the complete Profiling details page to view more comprehensive performance profiling data (such as CPU and memory dimensions) during that time period for in-depth root cause investigation.

Click View Profiling Details to navigate to the corresponding Profiling details page and view specific performance data.

Feedback

Is this page helpful? ×