title: Getting java.lang.OutOfMemoryError : java Heap space on Jboss
body: <p>Getting java.lang.OutOfMemoryError : java Heap space  on Jboss 7
  The entry in jboss configuration is </p>
  
  <pre><code>set "JAVA_OPTS=-Xms1G -Xmx2G -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=2096M"
  </code></pre>
  
  <p>The Error was</p>
  
  <pre><code> java.lang.OutOfMemoryError: Java heap space
          at java.util.Arrays.copyOf(Arrays.java:3332) [rt.jar:1.8.0_231]
          at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124) [rt.jar:1.8.0_231]
          at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448) [rt.jar:1.8.0_231]
          at java.lang.StringBuffer.append(StringBuffer.java:270) [rt.jar:1.8.0_231]
          at java.io.StringWriter.write(StringWriter.java:112) [rt.jar:1.8.0_231]
          at java.io.PrintWriter.write(PrintWriter.java:456) [rt.jar:1.8.0_231]
          at java.io.PrintWriter.write(PrintWriter.java:473) [rt.jar:1.8.0_231]
          at java.io.PrintWriter.print(PrintWriter.java:603) [rt.jar:1.8.0_231]
          at java.io.PrintWriter.println(PrintWriter.java:756) [rt.jar:1.8.0_231]
          at java.lang.Throwable$WrappedPrintWriter.println(Throwable.java:765) [rt.jar:1.8.0_231]
          at java.lang.Throwable.printEnclosedStackTrace(Throwable.java:698) [rt.jar:1.8.0_231]
          at java.lang.Throwable.printEnclosedStackTrace(Throwable.java:710) [rt.jar:1.8.0_231]
  </code></pre>