"In-depth understanding of Java Virtual Machine" tuning case study and actual combat

Source: Internet
Author: User
Tags visualvm

Previous section Study review

In the previous section, the main study of the sun jdk some of the command line and visual performance monitoring tools for specific use, but the focus of performance analysis is to solve the problem of the idea, there is no good ideas, and then good tools are futile.

This section focuses on learning

In the book, the main content of this section is to talk about the author in the work process of some of the best experience in combat. For our readers, the focus is to learn the specific ideas that the authors analyze to solve the problem. Of course you can't leave the contents of the book, the author uses the tools described in the previous section to solve the problems he has encountered. But my working environment is inconsistent with the textbook tutorial, but the idea is similar. So in this chapter of the study notes, or the combination of their own situation, talk about tuning it.

My working environment

In the previous section of the study has been mentioned, because of my working environment, most of the use of IBM products, including servers, middleware, etc., where the Java virtual machine is IBM's J9 virtual machine. It's a bit different from the hotspot, because IBM has very little data, so tuning the JVM is also a challenge. So far, we can only try to compare the JVM parameters through the was console, and find a better solution. And IBM's products are a complete set of solutions, was at the same time to provide the application parameters jump, the operation of the virtual machine monitoring, etc. are integrated in a control console, as shown below:

The page for tuning JVM parameters is as follows:

The Performance monitoring homepage is as follows:

Performance monitoring There are many projects that you can choose from, such as the JDBC Connection pool, JVM runtime, Web container thread pool, and so on, where the Web container and JVM runtime are monitored as shown:

Through the graph to observe the JVM heap memory usage trend, through the curve also probably can see the GC situation.

One tuning Experience

One of the most memorable tuning is the 2014 Brazil World Cup, 7 days 7 nights down the most tragic is that you are watching the World Cup, and we are in the day and night to maintain the system of the World Cup activities. Vaguely remember to participate in the number of people about million, the system regularly strikes, so have to temporarily day and night maintenance side repair tuning. The problem is probably to some concurrency bottleneck, and the system slows down and even blocks. Due to the online activity of the production environment, the customer requests that the activity cannot be stopped, even if it is blocked, and requires a temporary recovery by a restart. So our troubleshooting work is more difficult, in order to reproduce the phenomenon, we need to wait for the bottleneck of the time of day and night squatting. By observing the server metrics, it is not the bottleneck. Finally, the Kill-3 interval output multiple Javacore files for offline analysis, only to find out where the problem lies. And this Javacore file is analyzed by the software "IBM Thread and Monitor Dump Analyzer for Java" as shown below:

This visualizer provides very detailed information about the JVM, such as JVM startup parameters, GC information, line Chengjian, and so on, which are almost all covered by the command-line tool features of the Sun jdk. A bit like VISUALVM, but VISUALVM is dynamically monitored. Detailed query graph for threads:

Of course, now I think back to the tuning experience two years ago, there is not much sadness, more and more has become my work experience of the "milestone." Occasionally suddenly look back, still a little taste.

Summarize

Tuning is really a "labor" work, but the quality of personnel requirements are relatively high, as the above mentioned experience, is because of the lack of experience led to so long tuning time. Of course, sunshine always after the wind and rain, boil over, indeed progress a lot, write code bigger picture also raise a lot. So tuning this matter, is a good job interview, the most able to reflect the personal ability.

"In-depth understanding of Java Virtual Machine" tuning case study and actual combat

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.