How to overcome javaheap space problem : looking for solution | Community
Skip to main content
Gopalam
New Participant
October 21, 2020
Solved

How to overcome javaheap space problem : looking for solution

  • October 21, 2020
  • 1 reply
  • 2090 views

Hi all,


I'm currently facing the issue on AEM 6.3 version.
We are provisioning AEM using AWS and Terraform.
As soon as the ec2 spins up (Author instance/pub instance ), I get a problem that the java application doesn't start.

I normally do as work around:

./crx-quickstart/bin > ./status > to check the status > not connected
../crx-quickstart/bin > ./stop and ./start
and check the ./status again.

--------

i tried one method as well

./crx-quickstart/conf > sudo rm controlport

./crx-quickstart > ./stop and ./start again
.......
Even this method couldn't solve the problem.


Is there a feasible solution for this kind of problem.

how to check heap space:

ps -ef | grep java | grep Xmx ( example of publisher, same for author as well)


root 12790 12779 8 10:13 ? 00:11:47 java -Xmx4096M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dadmin.password.file=/var/tmp/admin_passwordfile.properties -jar /opt/cq/p/cq-publish-4503.jar -p 4503 -r publish,samplecontent -nointeractive -nofork
root 19556 1 0 10:19 ? 00:00:44 java -server -Xmx2048m -XX:MaxPermSize=256M -Djava.awt.headless=true -Dsling.run.modes=publish,crx3,crx3tar -jar crx-quickstart/app/cq-quickstart-6.3.0-standalone-quickstart.jar start -c crx-quickstart -i launchpad -p 4503 -Dsling.properties=conf/sling.properties

 

Thanks

BR,Gopalam

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jineet_Vora

Hello @gopalam,

At first, you would need to identify what is causing the heap space to grow What background threads or processes are consuming on your VM using Java or your AEM instance. There could be numerous reasons of Java heap space issue such as intensive resource consumption, unclosed resources in code base causing memory leaks, etc.

You can check using heap dump analysis. Check this post: http://www.aemcq5tutorials.com/tutorials/create-and-analyse-heap-dump-aem/

 

For a temporary workaround, you may be can try to increase the Xmx parameter for memory allocation but ideally the leakages if any should be fixed.

Hope this helps!

Jineet

1 reply

Jineet_Vora
Jineet_VoraAccepted solution
New Participant
October 26, 2020

Hello @gopalam,

At first, you would need to identify what is causing the heap space to grow What background threads or processes are consuming on your VM using Java or your AEM instance. There could be numerous reasons of Java heap space issue such as intensive resource consumption, unclosed resources in code base causing memory leaks, etc.

You can check using heap dump analysis. Check this post: http://www.aemcq5tutorials.com/tutorials/create-and-analyse-heap-dump-aem/

 

For a temporary workaround, you may be can try to increase the Xmx parameter for memory allocation but ideally the leakages if any should be fixed.

Hope this helps!

Jineet

kautuk_sahni
Employee
November 3, 2020
Thank you for answering this.
Kautuk Sahni