Setting JVM Parameters for the MgC-Agent Server
Windows
The following procedure uses Windows 11 as an example.
- Create system variables.
- Log in to the server where the MgC-Agent is installed as an administrator. Press Win+R on the keyboard to open the Run window.
- Enter sysdm.cpl and press Enter to open the System Properties window.
- On the Advanced tab, click Environment Variables.
- In the Environment Variables window, click New in the System variables area.
- Enter MGC_AGENT_JVM_OPTS in the Variable name text box, enter -Xms512M -Xmx1024M in the Variable value text box, and click OK.
-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.
- Click OK in the Environment Variables and System Properties windows to save the changes.
- Restart the MgC-Agent server.
- Open the task manager of the server where the MgC Agent was installed.
- On the Details tab, right-click MgC-Agent and choose Start from the shortcut menu.
- After the MgC Agent is started, go to the login page.
- Query the JVM parameters of the running MgC-Agent server.
This step requires that the Java development environment be installed on Windows.
- Press Ctrl+Alt+Delete and select Task Manager on the displayed page to open it. Click the Details tab, find the MgC-Agent.exe program, and note the PID of the program.
- Open the CLI as the administrator, enter the following command, and press Enter:
jinfo <PID>
In the preceding command, PID indicates the PID of MgC-Agent.exe. You can view the effective JVM parameters in the command output.
Linux
The following uses CentOS 8 as an example.
- Create system variables.
- Log in to the server where MgC-Agent is installed as the administrator and run the following command to open the configuration file:
sudo vim /etc/profile
- Add the following parameters to the configuration file:
export MGC_AGENT_JVM_OPTS="-Xms512M -Xmx1024M"
- After the addition is complete, run the following command:
source /etc/profile
- Log in to the server where MgC-Agent is installed as the administrator and run the following command to open the configuration file:
- Restart the MgC-Agent server. If the MgC Agent is running, stop the MgC-Agent server and the pre-installed collectors first.
- Go to the scripts directory in the MgC Agent installation directory.
cd /opt/cloud/MgC-Agent/scripts/
- Run the following command to stop the MgC Agent:
sh stop.sh
- Run the following command to start the MgC Agent:
sh start.sh
- Go to the scripts directory in the MgC Agent installation directory.
- Query the JVM parameters of the running MgC-Agent server.
ps -ef|grep java
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot