EM agent start fails With 'java.lang.OutOfMemoryError'
I will show how to solve EM Agent failing to startup related to java memory problems.
Suddenly i found my agent is not starting with error Failed. So now its time to find issue and need to fix.
I have checked multiple logfiles but found this error in emagent.nohup, there was an error related to java memory:
It was an "Out of Memory Exception". To solve it, I had to increase the java heap space allocated to emagent.
(Reference Oracle Doc Id- 1399201.1)
Edit '$AGENT_BASE/agent_inst/sysman/config/emd.properties' and increase the memory allocated to 512M.
Before-
cat emd.properties | grep agentJavaDefines
agentJavaDefines=-Xmx128M -XX:MaxPermSize=96M
After-
cat emd.properties | grep agentJavaDefines
agentJavaDefines=-Xmx512M -XX:MaxPermSize=96M
Now Try to restart agent using "emctl start agent".
emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved.
Starting agent ..................... started.
if you still face any issues, you will need to clear the agent state and retry.
Do the following:
- Stop and kill any remaining process related to EM Agent that is still running (perl or java).
- Clean all files from '$AGENT_BASE/agent_inst/sysman/emd/state/*' folder (or move them to a temporary place).
- Clear agent state by running: emctl clearstate agent.
- Increase the memory allocated editing emd.properties, as showed before, if not already done.
- Try to start the agent again.