When you get Java Heap memory related error java.lang.OutOfMemoryError. It is basically is JVM heap size problem. So for increasing the JVM Heap Size of Tomcat in Windows two way is there.
Method 1:
You have to create environment variable with name JAVA_OPTS and value -Xms256m -Xmx512m of course you can change the 256 and the 512 to whatever values you want. Here is the step by step process.
1. Right click on computer icon and click on properties.
2. Click on advanced system setting link.
3. Select the advanced tab.Here is the screen shot.
4. Click on Environment Variables button.
5. On system variables part :
- Click on new button.
- In the variable name, type : JAVA_OPTS
- In the variable value, type: -Xms256m -Xmx512m
- Click ok -> ok ->ok.
Now you have the environment variable JAVA_OPTS set to -Xms256m -Xmx512m.
Here -Xms256m (minimum of 256 MB)
-Xms512m (maximum of 512 MB)
Method 2:
Go to catalina.bat, catalina.bat is present in bin folder of your Tomcat Directory, and set this.
set JAVA_OPTS=-Xms128m -Xmx192m
Thanks a Lot it worked .....! :)
ReplyDeleteGreat thanks!
ReplyDeletethanks it is increased but i need one more help like used % is becoming high upto 99% in Survivor Space and Eden Space due to this tomcat not running
ReplyDeletewhile running tomcat7.0 it getting the nullpointer exeception continiously can any one give the guide lines how to sort out this problem
ReplyDeletehow to increase the Tenured Gen and Code Cache,Perm Gen [shared-ro],Perm Gen [shared-rw] these memory pl z guide me how can we increase the size in tomcat7.0 using jdk7
ReplyDeleteThanks for this...
ReplyDeleteActually many more things i learn form this site..
keep update this site..