Java heap Space Setup method record

Source: Internet
Author: User

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
  1. #                    logging_manager= "-djava.util.logging.manager=org.apache.juli.classloaderlogmanager"   
  2. #  
  3. #  $Id:  catalina.sh 1498485 2013-07-01 14:37:43z markt $  
  4. # ------- ----------------------------------------------------------------------  
  5. JAVA_OPTS= "- xms128m -xmx1512m "    
  6. # OS  specific support.   $var  _must_ be set to either true  or false.  
  7. Cygwin=false
  8. Darwin=false
  9. Os400=false
Restart Tomcat: [Plain]View PlainCopy
  1. tomcat_path/bin/shutdown.sh  
  2. 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
  1. < role   rolename Span style= "margin:0px; padding:0px; Border:none; Background-color:inherit; " >= "Admin-gui " />,   
  2. < role   rolename Span style= "margin:0px; padding:0px; Border:none; Background-color:inherit; " >= "Manager-gui " />,   
  3. <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
  1. -xms512m   
  2. -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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.