In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you the brief introduction of JVM for Linux JIT diagnostic technology, which is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
To describe JVM for Linux JIT diagnostics, when migrating a Java program from a platform that uses SunJDK to a platform that uses IBMJDK, it is important to understand the differences between the optimization techniques used in the JVM of the two vendors, which may affect the program, and how to achieve better performance by tuning the optimization mechanisms available in IBMJVM.
Introduction to JVM for Linux JIT Diagnostics
The "write once, run everywhere" (WORA) principle applies only when porting pure Java ™bytecodes from a specific version of the Java virtual machine (JVM) on one platform to the exact same version of JVM on another different platform.
However, sometimes the migration process is not seamless. One factor that can have an impact on this migration process is that there are differences in the internal implementation of optimization techniques from different vendors.
When migrating a Java program from a platform that uses SunJDK to a platform that uses IBMJDK, it is important to understand the differences in the optimization techniques used in the JVM of the two vendors, which may affect the program, and how to achieve better performance by tuning the optimization mechanisms available in IBMJVM.
This article focuses on diagnosing problems encountered in JIT that may be encountered when migrating from SunHotSpotJVM to IBM JIT-based JVM.
While most of the content described in this article is generally applicable to IBMJVM1.3.1 and 1.4.2, it is particularly applicable to IBMJVM1.3.1 and JVM1.4.2forLinux, including Linux on POWER and PowerPC architectures.
In Sun's JVM1.3.1, both the JIT and HotSpot compilers are included and can be called with the-server or-hotspot option (default is client HotSpotVM), and the JIT,-hotspot option with the-classic option is the implied default value. In SunJDK1.4.1 and later versions, you can only use HotSpot. IBMJVM1.3.1 and 1.4.2 use a combination of JIT and MMI, which is the default mode of operation and can achieve the same functionality as HotSpot.
JVM JIT and MMI
The tool used to improve the performance of Java programs is the Just-In-Time (JIT) compiler. JIT is a code generator that converts Java bytecode into native code for the host platform. Java programs usually run faster when using JIT calls than when executing bytecode using an interpreter.
When JVM starts, many methods are loaded into JVM and executed.
If JIT is disabled, JVM starts quickly, but in most cases the program runs as slowly as the bytecode is interpreted. If JIT is enabled but some of JIT's adaptive optimization mechanisms are not used, an attempt is made to compile all methods at startup. For Mini Program, such as applet, it can be a problem when it takes longer to start JVM than to run the program.
IBMJVMMixedModeInterpreter (MMI) is closely integrated with JIT, which can alleviate this problem. It can be used for the same purpose as HotSpotVM, extending compilation methods beyond the lifetime of JVM. Among other features, MMI can calculate how many times a particular method has been executed. To achieve balanced performance, MMI has a default upper-limit counter for each platform supported by IBMJVM, which is carefully selected and has been extensively tested and studied.
Each time a method is executed, the upper limit counter of the method in MMI is subtracted by 1. When the upper counter of a method reaches zero (0), you can use JIT to compile the method into native code. So, like HotSpotVM, high-frequency methods-- "hotspots"-- are compiled by JIT after JVM is started, while low-frequency methods are compiled later, or may not be compiled throughout the life cycle of the JVM process.
IBMJVM1.3.1 and 1.4.2 also provide a non-standard option-Xquickstart-to improve the startup time of some Java programs. The-Xquickstart option causes JIT; to be run using a subset of optimization options, that is, a method that compiles quickly. This option applies to short-running programs, especially those whose execution time is not concentrated in a small number of "hot" methods. If the-Xquickstart option is used on long-running programs that contain some hot methods, then this option may lead to performance degradation.
Like other non-standard-X options, the implementation and existence of the-Xquickstart option may be modified without notice.
You can reduce the MMI upper limit counter to speed up the process of JIT compiling a method, or increase it to achieve the opposite effect. This is achieved by using an environment variable, IBM_MIXED_MODE_THRESHOLD, which, like other environment variables, needs to be set in the shell instance running the JVM process. Naturally, this variable is set before starting the JVM process and is valid for all methods executed in JVM.
Setting IBM_MIXED_MODE_THRESHOLD to 0 disables MMI so that all methods can be compiled with JIT as soon as they are loaded into JVM.
The IBMJVM runtime mode is as follows:
Both ◆ MMI and JIT are enabled
This is the default IBMJVM setting.
◆ MMI disabled, JIT enabled
All methods are compiled before * runs, that is, JVM startup time may be slow, but later performance will be good.
◆ MMI and JIT are disabled
JVM is a pure interpretation system. All code will not be compiled. Disabling JIT also automatically disables MMI and sets IBM_MIXED_MODE_THRESHOLD to 0, which effectively disables MMI, but not JIT.
MMI is a very effective interpreter that uses assembly code on the host platform to achieve optimization. Although JIT is not an integrated part of JVM, it is provided in the form of a shared library (libjitc). It is closely integrated with MMI, and JIT and MMI are two closely integrated technologies in IBMJVM.
The JIT implementation of SunJVM1.3.1,Sun used in JavaHotSpotVM or the classic JIT pattern is not exactly the same as IBM's JIT; there is no JIT at all in SunHotSpotJVM1.4.1. When migrating Java programs from SunJVM1.3.1 or SunJVM1.4.1 to IBMJVM, problems can occur in some very rare cases, ranging from performance degradation to incorrect results in code, as well as JVM hangs, crashes, and some exceptions.
The above is a brief introduction to JVM for Linux JIT diagnostic technology. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.