Recently been OutOfMemory error, record a little bit of Setup JVM virtual machine memory Java heap space method.
Tomcat 7 Reference: http://www.davidghedini.com/pg/entry/install_tomcat_7_on_centoshttp://blog.csdn.net/f_zongjian/ article/details/5723665 Online Find a half-day Tomcat Setup method, a variety of. Actually very simple, set the java_opts parameter.WindowsEnvironment to modify the "%tomcat_home%/bin/catalina.bat" file, add the following settings at the beginning of the file: set java_opts=-xms256m-xmx512mLinuxUnder%tomcat_home%/bin/catalina.sh, add the parameter settings at any point in the beginning:
[Plain]View PlainCopy
- # logging_manager= "-djava.util.logging.manager=org.apache.juli.classloaderlogmanager"   
- #
- # $Id: catalina.sh 1498485 2013-07-01 14:37:43z markt $
- # ------- ----------------------------------------------------------------------
- JAVA_OPTS= "- xms128m -xmx1512m "    
- # OS specific support. $var _must_ be set to either true or false.
- Cygwin=false
- Darwin=false
- Os400=false
Restart Tomcat:
[Plain]View PlainCopy
- tomcat_path/bin/shutdown.sh
- tomcat_path/bin/startup.sh
If the configuration is correct, then Tomcat will start normally. You can view the manager account via Http://localhost:8080/manager/status. To set up an account, refer to the following code to modify%tomcat_home%/conf/tomcat-users.xml, adding the following 3 lines:
[HTML]View PlainCopy
- < role rolename Span style= "margin:0px; padding:0px; Border:none; Background-color:inherit; " >= "Admin-gui " />,
- < role rolename Span style= "margin:0px; padding:0px; Border:none; Background-color:inherit; " >= "Manager-gui " />,
- <Userusername="Tomcat"Password="Tomcat"Roles="Admin-gui,manager-gui"/>
Eclipse is simpler, open run-run configurations, modify the VM underneath arguments arguments
[Plain]View PlainCopy
- -xms512m
- -xmx3072m
Of course, according to your own machine ... Many students are looking for how to add the program parameters in eclipse, as long as the above programs arguments inside add can.
Java heap Space Setup method record