How to overcome javaheap space problem : looking for solution

Avatar

Avatar

Gopalam

Avatar

Gopalam

Gopalam

21-10-2020

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

Java heap space problem

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Jineet_Vora

Avatar

Jineet_Vora

Jineet_Vora

26-10-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

Answers (0)