Updated on 2025-07-18 GMT+08:00

Setting JVM Parameters for Collectors

Windows

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

  1. Navigate to the location of the startup script.

    Go to the MgC Agent installation directory C:\MgC-Agent\tools\plugins\collectors\designcenter-collector-server\bin\start.bat. designcenter-collector-server can be replaced with the collector you want to configure. The supported collectors include:

    • Platform collector designcenter-collector-platform
    • Server collector designcenter-collector-server
    • Big data collector bigdata-migration
    • Database collector rda-collector-database
    • Container collector rda-collector-kubernetes
    • Storage collector rda-storage-collector

  2. Set the JVM parameters.

    1. In the directory C:\MgC-Agent\tools\plugins\collectors\designcenter-collector-server\bin\, right-click start.bat and edit the configuration parameters of start.bat.
    2. Add the following JVM parameters before -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. In the directory C:\MgC-Agent\tools\plugins\collectors\designcenter-collector-server\bin\, run the stop.bat script as the administrator to stop the collector.
    2. Run the collector startup script start.bat in the same directory.

  4. Query the JVM parameters of the collector.

    1. Press Ctrl+Alt+Delete and select Task Manager on the displayed page to open it. In the Task Manager dialog box, choose the Details tab.
    2. Find designcenter-collector-server.exe and check its PID.
    3. Open the CLI as the administrator, enter the following command, and press Enter:
      jinfo <PID>

      In the preceding command, PID indicates the PID of designcenter-collector-server.exe. You can view the effective JVM parameters in the command output.

Linux

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

  1. Navigate to the location of the startup script.

    Go to the MgC Agent installation directory, which defaults to /opt/cloud/MgC-Agent/tools/plugins/collectors/designcenter-collector-server. designcenter-collector-server can be replaced with the collector you want to configure. The supported collectors include:

    • Platform collector designcenter-collector-platform
    • Server collector designcenter-collector-server
    • Big data collector bigdata-migration
    • Database collector rda-collector-database
    • Container collector rda-collector-kubernetes
    • Storage collector rda-storage-collector

  2. Set the JVM parameters.

    1. Run the following command to go to the directory of designcenter-collector-server:
      cd /opt/cloud/MgC-Agent/tools/plugins/collectors/designcenter-collector-server/
    2. Create the start.sh file and run the following command to change the file permissions:
      chmod 755 start.sh
    3. Add the following information to the start.sh file:
      nohup java -jar -Xms256M -Xmx512M designcenter-collector-server.jar >/dev/null 2>&1 &

      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.

    4. Save and exit start.sh. 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