java lang OutOfMemoryError Java heap space

java lang OutOfMemoryError Java heap space

java.lang.OutOfMemoryError: Java heap space

If you are working on Java application and getting “java.lang.OutOfMemoryError: Java heap space” means there is no more space available on JVM heap and when try to more it throws exception. To fix this issue increase JVM heap space as shown below options:

-Xmsm –> This set initial Java heap size
-Xmxm –> This set maximum Java heap size

Above default value are -Xms32m and -Xmx128m

Based on your operating system and its memory please try to increase accordingly. Also its better to check how much memory your application is consuming using Profiler.

For more information please visits oracle official tutorial here

Leave a Reply

Your email address will not be published. Required fields are marked *

I am not Robot *