Search This Blog

Total Pageviews

What is java.lang.OutOfMemoryError in Java?

As the name specifies, this is the run time exception caused when there is no enough memory in Java Heap.

OutofMemoryError can be due to

1) Java Heap Space or
2) PermGen Space (Stores String Pools and various meta data)

This is not a program error, but programatic memory leaks could cause OutOfMemoryError.

How to Increase Memory?

Various JVM's(Eclipse/Tomcat/Weblogic/etc.,) has different ways to setup. Bottom line is set JVM args to increase memory.

set JVM_ARGS="-Xmx1024m -XX:MaxPermSize=256m"

How to find memory leaks?

Try Eclipse Memory Analyzer tool or Visualgc or Jmap to detect the problematic code.

No comments:

gradlew : The term 'gradlew' is not recognized as the name of a cmdlet, function, script file , or operable program

The command gradlew was not found, but does exist in the current location.  Windows PowerShell does not load commands from the current locat...