Search

6.11.2. Setting the Agent JVM Memory Size

download PDF
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 begin 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.
  1. Open the agent prompt. For example, if the agent process is already running, the prompt can be opened by re-running the rhq-agent.sh script with the -n option.
    agentRoot/rhq-agent/bin/rhq-agent.sh -n
  2. Use the setconfig command to set the RHQ_AGENT_JAVA_OPTS value with the -Xms and -Xmx parameters for the minimum and maximum bounds of the heap size for the agent JVM. For example:
    > setconfig RHQ_AGENT_JAVA_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=256M -Djava.net.preferIPv4Stack=true"
  3. Optionally, use -XX:PermSize and -XX:MaxPermSize to set the perm gen size.
  4. 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 stop
    
    [root@server ~]# service rhq-agent-wrapper.sh start

Note

It is also possible to stop the agent, edit the rhq-agent-env.sh file directly, and then restart the agent.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.