java.lang.OutOfMemoryError: Java heap space

Document ID : KB000008864
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

During the peak production hours when the volume of job execution on the CA Workload Automation Agent is high, the following Exception is collected in the file <AGENT_INSTALL_DIR>/nohup.stderr.

# more nohup.stderr

  Exception in thread "Execution:6167018068990963554" java.lang.OutOfMemoryError: Java heap space

        at cybermation.plugins.sap.communicator.CybSAPResponse.getTableImage(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPResponse.getTableImage(Unknown Source)

        at cybermation.plugins.sap.log.CybSAPLogAnalyzer.createSAPLog(Unknown Source)

        at cybermation.plugins.sap.log.CybSAPLogAnalyzer.createSAPLog(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.setJobLog(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.flashJobLogs(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.processStatusResponse(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.replyChangedJobStatusOnly(Unknown Source)

        at cybermation.plugins.sap.commands.CybSAPCommand.replyChangedStatusOnly(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.processResponse(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.processGroupOfResponses(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPJobManager.requestProcessedNotify(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPRequestProcessorBase.notifyCaller(Unknown Source)

        at cybermation.plugins.sap.communicator.CybSAPRequestProcessorBase.threadHandler1(Unknown Source)

        at cybermation.plugins.sap.communicator.CybExecutionThread.run(Unknown Source)

#

The Agent performance is very low and often noticed that the service goes down.

Environment:
All Workload Automation Agent 11.3+ version supported platforms
Cause:

The exception is due to the CA WA System Agent is running out of Java Virtual Machine allocated heap space. 

By default, 64MB of both minimum and maximum space allocated for the Agent.

If the agent is known to have high number of concurrent jobs, it is likely to hit the allocated heap space threshold and trigger an exception.

Resolution:

Java heap space size can be configured using the "oscomponent.jvm.x.options" parameter in the agentparm.txt file.

A higher maximum heap space can be set, if the agent encounters an java.lang.OutOfMemoryError: Java heap space exception.

Example: 

oscomponent.jvm.x.options=-Xms<initial heap size>;-Xmx<maximum heap size>

-Xms: Initial and minimum heap size.

-Xmx: Maximum heap size

For example:

oscomponent.jvm.x.options=-XX:+UseGetTimeOfDay;-Xms256m;-Xmx512m

 

The memory allocation and usage can be seen in the simple_health_monitor.log file.

Additional Information:

There are limitations on the JVM max heap space allocation based on the architecture (x32bit, x64bit) and Operating System.

Please review the operating system documentation before changing the max value to higher.