Show Table of Contents
3.3. Tuning the Agent JVM Memory Size
When an agent manages a large number of resources, it can begin running out of memory with the default settings of its JVM. This can cause errors like memory has crossed the threshold and is low to be recorded in the agent log, and the agent is automatically rebooted. This is usually caused by the agent's heap size being set too low, but it can also be related to a low perm gen size.
To change the agent's memory settings, use the
RHQ_AGENT_JAVA_OPTS in the rhq-agent-env.sh file to set the appropriate JVM settings.
- Stop the agent. For example, if the agent is running as a service:
[root@server ~]# service rhq-agent-wrapper.sh stop
- Open the
rhq-agent-env.shfile to set the required environment variables that the agent will use.[root@server ~]# vim agentRoot/rhq-agent/bin/rhq-agent-env.sh
- Set the
RHQ_AGENT_JAVA_OPTSvalue with the-Xmsand-Xmxparameters for the minimum and maximum bounds of the heap size for the agent JVM. For example:RHQ_AGENT_JAVA_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=256M -Djava.net.preferIPv4Stack=true"
- Optionally, use
-XX:PermSizeand-XX:MaxPermSizeto set the perm gen size. - Restart the agent process to load the new configuration. For example, if the agent is running as a service:
[root@server ~]# service rhq-agent-wrapper.sh start

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.