Updated on 2024-12-20 GMT+08:00

Setting JVM Parameters for Collectors

Windows

The following procedure uses Windows 11 and rda-collector-server as an example.

  1. Navigate to the location of the startup script.

    Go to the Edge installation directory (C:\Edge by default) and find .\tools\plugins\collectors\rda-collector-server\bin\start.bat. rda-collector-server can be replaced with the collector you want to configure. The supported collectors include:

    Database collector rda-collector-database

    Container collector rda-collector-kubernetes

    Platform collector rda-collector-platform

    Server collector rda-collector-server

    Storage collector rda-storage-collector

  2. Set the JVM parameters.

    1. In the Edge installation directory (C:\Edge by default), edit .\tools\plugins\collectors\rda-collector-server\bin\start.bat.
    2. Add the following JVM parameters after -jar in the second statement.
      -Xms512M -Xmx1024M

      In the preceding information, -Xms512M -Xmx1024M are the JVM parameters to be configured. -Xms512M indicates that the initial heap memory allocated to the JVM is 512 MB. -Xmx1024M indicates that the maximum heap memory that can be allocated to the JVM is 1,024 MB. You can add other JVM parameters as required.

    3. Save and exit start.bat. The JVM parameters are configured for the server collector.

  3. Restart the collector.

    The JVM parameters will be applied after the collector is restarted.
    1. Go to the Edge installation directory (C:\Edge by default) and run .\tools\plugins\collectors\rda-collector-server\bin\stop.bat as the administrator.
    2. Run the collector startup script start.bat in the same directory.

  4. Query the JVM parameters of the collector.

    1. Press Ctrl, Alt, and Delete and select Task Manager on the displayed page to open it. In the Task Manager dialog box, choose the Details tab.
    2. Find rda-collector-server.exe and check its PID.

    3. Open Command Prompt as the administrator, enter the following command, and press Enter:
      jinfo PID
      In the preceding command, PID indicates the PID of the Edge program. You can view the effective JVM parameters in the command output.
      Figure 1 Command prompt

Linux

The following procedure uses CentOS 8 and rda-collector-server as an example.

  1. Navigate to the location of the startup script.

    Go to the Edge installation directory. The default directory is /opt/cloud/Edge. Find /tools/plugins/collectors/rda-collector-server. rda-collector-server can be replaced with the collector you want to configure. The supported collectors include:

    Database collector rda-collector-database

    Container collector rda-collector-kubernetes

    Platform collector rda-collector-platform

    Server collector rda-collector-server

    Storage collector rda-storage-collector

    Big data collector bigdata-migration

  2. Set the JVM parameters.

    1. In the Edge installation directory (/opt/cloud/Edge by default), edit /tools/plugins/collectors/rda-collector-server.
    2. Create the start.sh file and add the following information to the file:
      nohup java -jar -Xms256M -Xmx512M rda-collector-server.jar >/dev/null 2>&1 &

      In the preceding information, -Xms512M -Xmx1024M are the JVM parameter to be configured. -Xms512M indicates that the initial heap memory allocated to the JVM is 512 MB. -Xmx1024M indicates that the maximum heap memory that can be allocated to the JVM is 1,024 MB. You can add other JVM parameters as required.

    3. Save and exit start.bat. The JVM parameters are configured for the server collector.

  3. Restart the collector.

    The JVM parameters will be applied after the collector is restarted.
    1. Run the following command to view the PID of the collector:
      ps -ef|grep java
    2. Enter the following command and press Enter to stop the collector.
      Kill -9 PID
    3. Enter the following command to run the new startup script start.sh:
      sh start.sh

  4. Query the JVM parameters of the collector.

    Run the following command to view the JVM parameters of the collector:

    ps -ef|grep java