title: Tomcat 8.5.15 on ubuntu 16 out of memory error
body: <p>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.</p>
  
  <p>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. </p>
  
  <blockquote>
    <p>export CATALINA_OPTS="$CATALINA_OPTS -Xmn1290240k -Xmx2024m -XX:MaxMetaspaceSize=2024m -XX:SurvivorRatio=4 -server"</p>
  </blockquote>
  
  <p>But, tomcat is failling with outofmemory error. I need to create a file of minimumg size 250M.</p>
  
  <p>Thanks in advance. </p>