In the recent project development, always encounter the startup project back to the memory overflow, first we have to identify the problem, MyEclipse boot Tomcat ignores catalina.bat to set the memory size, so if you start the Tomcat memory overflow with MyEclipse, and Tomcat starts without error, it must be myeclipse configuration problem, the solution is as follows:
Because the author uses Myeclipse10, Tomcat 6, so with MyEclipse10, tomcat6 as an example, click on the Top MyEclipse toolbar window--> Preference, and then click on MyEclipse- > Servers--> tomcat--> Tomcat 6.x--> JDK, then set the following information in optional Java VM arguments:
-server-xms512m-xmx512m-xx:permsize=256m-xx:maxpermsize=256m
Click Apply and click OK. OK, restart the project.
If you start the Tomcat memory overflow directly, you need to manually set the JVM memory size.
Linux to modify the JVM memory size:
To add the catalina.sh in the Tomcat bin, position cygwin= False before.
# OS specific support. $var _must_ is set to either True or false.
java_opts= "-xms256m-xmx512m-xss1024k-xx:permsize=128m-xx:maxpermsize=256m"
Cygwin=false
To modify the JVM memory size under windows:
Case one: Extract version of Tomcat to load configuration via Startup.bat boot tomcat
To be added under Tomcat's bin in Catalina.bat
REM Guess catalina_home if not defined
The set current_dir=%cd% is added after the red ones are added for the new.
Set Java_opts=-xms256m-xmx512m-xx:permsize=128m-xx:maxnewsize=256m-xx:maxpermsize=256m-djava.awt.headless=true
Situation Two: Install version of Tomcat under no Catalina.bat
The Windows service executes Bin\tomcat.exe. He reads the values in the registry, not the Catalina.bat settings.
Modify Registry Hkey_local_machine\software\apache SOFTWARE Foundation\tomcat Service manager\tomcat5\parameters\javaoptions
The original value is
-dcatalina.home= "C:\ApacheGroup\Tomcat 5.0"
-djava.endorsed.dirs= "C:\ApacheGroup\Tomcat 5.0\common\endorsed"
-xrs
Join-xms300m-xmx350m
Restart the Tomcat service and the settings take effect.
A simple analysis of the problem, please see the next article "Tomcat memory Overflow problem simple analysis"