Use the runtime diagnosis skill

Updated at:

Runtime diagnosis analyzes issues such as CPU, memory, garbage collection (GC), and threads that occur during the runtime of a Java application, and provides expert-level root cause diagnosis and tuning suggestions. This topic describes how to submit a diagnostic file or specify the machine and process, view the analysis results, and continue to ask follow-up questions in the SysAgent conversation box.

Scenarios

Prepare the corresponding diagnostic input based on the issue symptoms:

  • Heap dump: Troubleshoot memory overflow, heap memory leaks or continuous growth, off-heap memory, or class loader leaks. You need to provide a .hprof or .bin file.

  • GC log: Troubleshoot frequent GC, Full GC, excessively long pause time, low collection efficiency, or GC parameter issues. You need to provide a GC log file.

  • Thread dump: Troubleshoot deadlocks, thread blocking, abnormal thread count, thread pool exhaustion, lock contention, or high CPU utilization. You need to provide a thread dump file.

  • Java Flight Recorder (JFR): Troubleshoot CPU hotspots, lock contention, I/O latency, memory allocation hotspots, or latency spikes. You need to provide a .jfr file.

Preparations

  • Identify the issue symptoms and the time when the exception occurred.

  • Prepare a diagnostic file that corresponds to the issue, or prepare the target machine ID and application process information.

  • When you use a download link, make sure that the link can be downloaded directly and is still valid.

  • Do not enter AccessKey pairs, passwords, or tokens in the request.

Submit a diagnosis request

Log on to the Alibaba Cloud Operating System Console and open the SysAgent conversation box. Click Skills, select Runtime diagnosis, enter the type of issue to diagnose (one of GC log, heap dump, thread dump, or JFR), then provide the diagnostic file by using either of the following methods, and finally click Send.

  • Upload a local file: Click Upload file and select a diagnostic file, and enter the issue symptoms, the time of occurrence, and the direction of concern.

  • Provide a download link: Enter the issue description and paste a link from which the file can be downloaded directly, and make sure that the link has not been shortened, re-encoded, or modified.

  • Specify the machine and process: Enter the target machine ID, process ID (PID), or application name, and describe the issue symptoms.

View the analysis results

After the analysis is complete, check the following parts in sequence:

  1. Overall overview: View the Java runtime environment and related statistics.

  2. Excluded items: View the directions that have been checked and excluded and their basis.

  3. Root cause: View the cause of the issue and the corresponding reference relationships, thread stacks, or statistics.

  4. Fix suggestions: View the adjustment suggestions for the code, configuration, or Java Virtual Machine (JVM) parameters.

The key results vary with the input: heap dumps focus on object usage, reference paths, off-heap memory, and class loaders; GC logs focus on pauses, collection efficiency, memory trends, and parameter assessment; thread dumps focus on deadlocks, lock contention, blocking aggregation, thread pools, and hotspot stacks; JFR focuses on hotspot methods, call paths, and CPU, lock, I/O, or memory allocation bottlenecks.

Note

The conclusions are based on the actual diagnostic data. When the data is insufficient or the collection window does not cover the issue, the results describe the analysis boundary and provide the data that needs to be supplemented or a suggestion to collect the data again.

Verify and continue the analysis

  1. Check whether the analysis file, target machine, or application process is consistent with the issue site.

  2. Check the root cause against the reference relationships, thread stacks, or statistics.

  3. If you need to further expand a piece of evidence or a suggestion, ask a follow-up question in the same conversation.

  4. Confirm the adjustment plan and its impact, and collect the same type of diagnostic data again after you complete the adjustment.

  5. Compare the abnormal symptoms and key metrics before and after the adjustment.

Limits

  • Only one file type is diagnosed in one conversation. To analyze another type, create a new conversation.

  • Only one file is submitted in one message. Batch analysis of multiple files is not supported.

  • A local file path cannot be used as a diagnostic input. Upload a file, provide a downloadable link, or specify the machine and process.

FAQ

  • File download fails: check whether the link is expired, whether it can be accessed directly, or whether additional authentication is required.

  • The file cannot be identified: make sure that the file type is consistent with the issue scenario, and provide it again.

  • The file is corrupted or incomplete: collect or upload a complete file again.

  • The file cannot be obtained: check the machine ID, process ID, or application name, and resubmit.

  • The conclusion has insufficient evidence: supplement the exception time, reproduction conditions, or new diagnostic data.