Creating a Memory Usage Diagnosis Task
The tool analyzes memory usage problems of applications, including unreleased memory and abnormal memory releases.
Prerequisites
At least one node has been installed successfully.
- Memory usage diagnosis tasks are not supported on SUSE Linux.
- Memory usage diagnosis tasks do not apply to Docker containers but to processes in containers.
Creating a Memory Usage Analysis Task
- Click
next to System Diagnosis. - Set task parameters. See Task Management and Table 1.Figure 1 Creating a memory usage analysis task
Table 1 Parameters for creating a memory usage analysis task Parameter
Description
Task Name
Name of the task. The name must meet the following requirements:
- Contain only letters, digits, and special characters (including @#$ %^&*()[]<>._-!-+ and spaces). The name cannot start or end with a space.
- Contain 1 to 32 characters.
Diagnosis Object
Select Memory.
Select Nodes
Select the nodes to be analyzed. If there is only one node, this node is selected by default.
Mode
Mode for application analysis. Possible values are Launch application (default) and Attach to process.
Application Path
Absolute path of the application to be analyzed, for example, /opt/mysql/mysqld.
NOTE:- By default, applications in the /opt/ or /home/ directory are analyzed. The administrator can click
> Tool Settings in the upper right corner on the home page of the System Diagnosis and choose System Settings, and enter application paths in the Application Path test box. Use semicolons (;) to separate multiple application paths. Only administrators can modify this parameter. Common users can only view this parameter. - Only C/C++ applications can be collected and analyzed.
(Optional) Application Parameters
Used for executing the application. Example: --defaults-file=/opt/mysql/my.cnf. Set this parameter based on the actual scenario.
PID
Enter the process ID. Only one process ID can be associated. This parameter is mandatory when Attach to process is selected for Mode.
NOTE:If PID is set to -1, the kernel-mode memory usage is monitored.
Diagnosis Scenario
The default value is Memory usage and cannot be changed.
NOTE:- Currently, memory usage diagnosis is unavailable in a container environment.
- This function is implemented based on the extended Berkeley Packet Filter (eBPF) capability. The root user is required for data collection. You are advised to use applications that have been running for a long time.
eBPF Run User
User for running the eBPF. The default value is root and cannot be changed.
Password
Password of the eBPF run user.
Sampling Duration (s)
Sampling duration, in seconds. The default value is 1. The value range is 1 to 1800. The sampling duration must be no less than the sampling interval.
Sampling Interval (s)
Sampling interval, in seconds. The default value is 1. The value ranges from 1 to 60. You need to set this parameter in Advanced Settings.
Top Stack Trace
Collects information about top N stacks with the highest memory usage in each sampling interval. The default value is 5. The value ranges from 5 to 15. You need to set this parameter in Advanced Settings.
(Optional) Memory Size Filtering (byte)
Range of memory usage collected each time. You can set this parameter in Advanced Settings.
- Click Verify and Create.
You can click the icons next to the task name to perform the following operations:
: stops the analysis task. After an analysis task is stopped, the collected information will be deleted.
: restarts the analysis task. You can modify task parameter settings and restart an analysis task. This button is available when a task is canceled or fails.
: performs the analysis again. The analysis task is renamed and restarted.
: deletes the analysis task. After a task is deleted, all data of this task will be deleted. Exercise caution when performing this operation.
: changes the task or report name. The report naming rule is the same as that of a task.
- Before the memory usage diagnosis, check whether the environment meets the BCC or eBPF running conditions.
- The collection and analysis task will not be interrupted if you exit or switch to another page.
- After being authenticated, you can log in to the system again to view the execution progress of an ongoing task or the analysis report of a completed task.