Reputation: 33
I am using tomcat-8.5.15 on ubuntu-16 with java version version 1.8.0_131-8u131. I am trying to create a file by java code from byte array on tomcat server of large size, but tomcat is failing with java.lang.OutOfMemoryError: Java heap space error.
I search on google, and figure out there should be a file "setenv.sh" inside bin directory of tomcat, and set below configuration, as MaxMetaspaceSize are new heap space concept for java 8.
export CATALINA_OPTS="$CATALINA_OPTS -Xmn1290240k -Xmx2024m -XX:MaxMetaspaceSize=2024m -XX:SurvivorRatio=4 -server"
But, tomcat is failling with outofmemory error. I need to create a file of minimumg size 250M.
Thanks in advance.
Upvotes: 2
Views: 1296
Reputation: 11
if you installed your tomcat from ubuntu repository then just locate tomcat8 file, usually is /etc/default/tomcat8 and edit by changing the value of JAVA_OPTS to 2048m leave everything else the same. restart tomcat.
Upvotes: 1