Performance impact of Java JVM settings

Source: Internet
Author: User

A rear end server,os for Slackware 8.1, installed Tomcat 4.1.30, in the recent busy times will often panic, death is "java.lang.OutOfMemoryError:unable to create new native Thread ". It is tomcat that cannot create new threads to answer requests. So I set up a special environment to test this problem. Memory for 2G,CPU for four 2.8g,tomcat 4.1.30, write a simplest JSP page, as follows:

Code

  <%
   try
   {
   Thread.sleep(30000);
   out.println("fuck");
   } catch (InterruptedException e) {
   e.printStackTrace();
   } %>

Then open jmetor to pressure, while opening jconsole to monitor the situation of Tomcat, and constantly adjust the XMX,XMS,XSS three parameters, the following table:

  XMX XMS XSS down时的tomcat thread数
   500M 500M 128K 642
   800M 800M 64K 485
   1024M 1024M 64K 374
   1024M 1024M 128K 374
   1024M 1024M 512K 371

According to the table, the larger the amount of memory that is allocated to the JVM, the smaller the number of thread that tomcat can open with Xmx, and the XSS parameter hardly affects any test results. I guess the tomcat thread is using Linux memory, not the JVM's memory. The larger the memory allocated to the JVM, the smaller the memory the operating system can allocate, and the smaller the number of threads that can be opened.

Do you have any solutions? Have we never met this problem? My assumption is that Linux initially each process (that is, tomcat open thread) has an initial size, this should be a kernel parameter, it should be small on it, but I do not know how to tune.

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.