Search code examples
javajava-8jvmsap-commerce-cloud

Java.lang.OutOfMemoryError: Java heap space [Ubuntu]


i am trying to run my code and i got this error on my console

 [java] Caused by: java.lang.OutOfMemoryError: Java heap space

i run Jconsole on jdk folder the max heap 1.9m ,how can i change it ?


Solution

  • As for hybris, you need to update tomcat.generaloptions property to adjust Xmx value. For instance, via local.properties. -Xmx2G is a default value.

    tomcat.generaloptions=-Xmx4G -ea -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dorg.tanukisoftware.wrapper.WrapperManager.mbean=true -Djava.endorsed.dirs="%CATALINA_HOME%/lib/endorsed" -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA_HOME% -Dfile.encoding=UTF-8  -Djava.util.logging.config.file=jdk_logging.properties -Djava.io.tmpdir="${HYBRIS_TEMP_DIR}"