The app will hang up for a while (the process is in, but it stops responding, and there is no log output) and you must restart Tomcat

Source: Internet
Author: User

Here is the reprint is to do the notes for yourself

problem : The application will hang up after a period of time (process in, but stop responding, also no log output), you must restart Tomcat

Reason Lookup :
Since there is no error in Tomcat's own log, enough disk space, read and write, and other reasons suspected of a JVM crash, then check the GC log:

It can be seen that every time the full GC is the old memory footprint is quite small, far from reaching its maximum value, the same as the persistent generation, and each time after the GC, the amount of basic no change, that is, every time the full GC is doing no work, wasted a large number of performance. In terms of memory usage, it is not enough memory allocation, it should be a problem with the program code, so look for development assistance. Later, with the assistance of the relevant developers found in the code in the active call System.GC (), the web search, and found that even the official website is not recommended in the Code System.GC (), also do not dare to ensure the use of its impact on the performance and stability of the application. In fact, from the JVM configuration level can also disable the active GC () method call, plus the parameter "-XX:+DISABLEEXPLICITGC" on it, and then add this parameter restart Tomcat, over a period of time to view GC Log,ok, the reason to find, problem solving! The background is also for development. It is recommended that you do not invoke the System.GC () method in your code to automatically process the GC with the JVM itself.

workaround : The JVM is configured with the parameter "-XX:+DISABLEEXPLICITGC", and the Code prohibits calling System.GC ();

The app will hang up for a while (the process is in, but it stops responding, and there is no log output) and you must restart Tomcat

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.