What actually is "java.lang.OutOfMemoryError: Java heap space" and how can i increase the Memory for Java?

4.1k Views Asked by At

Actually i am running Wowza Media Server on CentOS v6.3 64-bit Linux. Then it used to be suddenly stopped in some days and whenever i check the logs, i always see:

java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

If i have to increase the memory rooms for Java:

  • how can i simply do it please?
  • have 72GB in my Dedicated Server, and 60GB is always free, can i give all 60GB to Java like that please?
2

There are 2 best solutions below

0
On

You can change the amount of memory allocated for use by your JVM using the -Xms and -Xmx command line parameters.

4
On

You can adjust memory usage by setting up -Xms and Xmx parameters in setenv.sh file of Wowza under the bin directory.