How to resolve java.lang.OutOfMemoryError?

To solve the OutOfMemory error, try increasing the permgen space, while starting the jvm. Use the following option while starting a java application.

java -XX:PermSize=512M -XX:MaxPermSize=128M App.java

If you are using tomcat server in windows environment, do the following.

Right click tomcat icon in the task bar -> click java tab -> inside java options field append the following

 
 -DXX:PermSize=512M
 -DXX:MaxPermGen=512m

Search