Creating a Sampling Profiling Task
The tool collects internal activities and performance events of the JVM through data sampling, and performs offline analysis through data recording and playback. This method requires only a small overhead and has little impact on services, making it suitable for large Java programs. For details, see Table 1.
Prerequisites
- A target environment has been added and is online.
- The JDK that runs the Java process must be BiSheng JDK 8.302 or later or OpenJDK 9 or later.
If the Java Profiler was deployed by an OS administrator and you want to perform sampling analysis on a Java process that was not created by an OS administrator, ensure that the JDK running the Java process is BiSheng JDK 8.302 or later or OpenJDK 9 or later, and configure the JAVA_HOME environment variable in the non-interactive shell. For details, see Configuring the JDK.
Procedure
- On the left area of the Java Profiler, select the target environment in the Target Environments list. Under Java Processes on the right, select the target Java process. See Figure 1.
Figure 2 Selecting a container process
You can click
to import a downloaded report and perform verification during the import.
- Java processes in containers can be analyzed, and Java applications in pods can be analyzed remotely (when Kubernetes compute nodes are not connected).
- Container processes can be filtered by namespace. If the namespace value is - -, there is no namespace. If the pod value is - -, there is no pod.
- Click Sampling Profiling.
The Add Sampling Analysis page is displayed, as shown in Figure 3. For details about the parameters, see Table 1.
Table 1 Parameters for adding a sampling analysis task Parameter
Description
Recording Mode
Recording mode. The options are:
- Specified duration: You can specify the sampling duration.
- Continue until manual stop: The sampling duration cannot be customized.
NOTE:
The maximum size for Continue until manual stop is 250 MB. When the size exceeds 250 MB, the system overwrites the earliest data to retain the latest 250 MB content.
Duration (s)
Recording duration. The default value is 60. The value range is 1 to 300.
Method Sampling
Indicates whether to enable method sampling. This function is enabled by default.
Java Method Sampling Interval (ms)
Interval at which the Java method sampling is performed. The default value is 1. The value range is 1 to 1000.
NOTE:This parameter is unavailable if Method Sampling is disabled.
Native Method Sampling Interval (ms)
Interval at which the Native method sampling is performed. The default value is 1. The value range is 1 to 1000.
NOTE:This parameter is unavailable if Method Sampling is disabled.
Thread Dump
Indicates whether to enable thread dump. This function is enabled by default.
Dump Interval (s)
Interval at which the thread dump is performed. The default value is 1. The value range is 1 to 300.
NOTE:- This parameter is unavailable if Thread Dump is disabled.
- The value of Dump Interval must be less than or equal to the value of Duration. You are advised to set Dump Interval to 1, 5, 10, 20, 30, or 60.
File I/O Sampling
Indicates whether to enable file I/O sampling. This function is disabled by default.
Threshold (μs)
File I/O sampling threshold. The default value is 500. The value range is 0 to 1,000,000.
This parameter is displayed only when File I/O Sampling is enabled.
NOTE:The tool captures only the file I/Os that exceed the threshold for analysis.
Socket I/O Sampling
Indicates whether to enable socket I/O sampling. This function is disabled by default.
Threshold (μs)
Socket I/O sampling threshold. The default value is 1000. The value range is 0 to 1,000,000.
This parameter is displayed only when Socket I/O Sampling is enabled.
NOTE:The tool captures only the socket I/Os that exceed the threshold for analysis.
Old-Generation Object Sampling
Indicates whether to enable old-generation object sampling. This function is enabled by default.
- Set parameters according to Table 1 and click OK.
The task process is displayed. See Figure 4.
- You can click Stop or Cancel to stop or cancel the sampling analysis task respectively.
- After the sampling analysis task is complete, you can click View Details on the upper left of the report page to view the tuning suggestions on all tab pages.
- Deleting a sampling analysis report will delete all historical data of the analysis task. Exercise caution when performing this operation.
- If you delete a sampling analysis report that is opened on the current tab page, the tab page is reserved temporarily. After you close or refresh the tab page, the report data is deleted.


