In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to understand JVM for Linux JIT diagnosis technology, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
JVM has a lot to learn. Just-In-Time (JIT) compiler and Mixed ModeInterpreter (MMI) optimization techniques are briefly introduced, which are used in JVM1.3.1 and 1.4.2 of IBM, which may have an impact on Java programs migrated from SunHotspotJVM.
Brief introduction of JVM for Linux JIT Diagnostic Technology
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 IBM JVM.
This article focuses on diagnosing problems encountered in JVM for Linux JIT that may be encountered when migrating from SunHotSpotJVM to IBM JVM for Linux 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 for Linux JIT and MMI
The tool used to improve the performance of Java programs is the Just-In-Time (JIT) compiler. JVM for Linux 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.
IBM JVMMixedModeInterpreter (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.
IBM JVM1.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 IBM JVM 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 JVM for Linux 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 JVM for Linux 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.
This is the answer to the question about how to understand JVM for Linux JIT diagnosis technology. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.