Sun Classic VM
- The world’s first commercial model
Java
The virtual machine,JDK1.4
Already eliminated. - Internal only interpreter, can be their own plug-in
JIT
Compiler, but you can only use one or the other, not work together. hotspot
The virtual machine is built in.
The interpreter, which requires execution line by line, is inefficient. For example, if we loop 2,000 times, the loop body is so large that each execution needs to be interpreted.
The JIT compiler, in addition to direct all instantaneous compiling, can also statistics out those code execution frequency is higher, this code is the hot spot in the code, the JIT compiler will hot code, compiled into machine instructions in advance, cached method in area, next to, don’t need to explain, but direct operation machine instructions. (At this point, the Classic VM does not yet have hot code detection, it will all be compiled ahead of time)
The just-in-time compiler is very efficient, so why not compile it all in advance and cache it?
- All compiled ahead of time, the first startup response is slow, there will be a sense of lag, because compilation takes a lot of time. (Main reason)
- Cache code, need to be placed in the method area, take up memory space, easy to overflow.
- Translation into machine instructions, then this part of the cache
CodeCache
Is not directly cross-platform, because the machine instructions in different environments are not the same, can only be compiled before each run.
Exact VM
To solve the problem of the previous VM, the Classic VM (with only one interpreter or just-in-time compiler), was introduced in JDK 1.2.
Exact Memory Management: A VM can know the Exact type of data at a specific location in the Memory.
The VIRTUAL machine has initially had the prototype of the current high-performance virtual machine:
- Hot code detection
- Compilers and interpreters work together
Unfortunately, the Exact VM was only used briefly on Solaris before being replaced by Hotspot.
HotSpot VM
One of the three commercial virtual machines. Designed by Longview Technologies, a small company that was acquired by Sun in 1997 and Oracle in 2009. The JDK 1.3 HotSpot became the default virtual machine, and it still is (JRockit and J9 have no method area). HotSpot has applications on servers, desktops, mobile, embedded, etc.
HotSpot gets its name from HotSpot code detection technology:
- Find the code with the most compile value through the counter, triggering just-in-time compilation and on-stack replacement.
- The compiler and interpreter work together to achieve a balance between response time and optimal execution performance. The interpreter is responsible for startup time, while the compiler is mainly concerned with execution efficiency.
JRockit
One of the three commercial virtual machines. In 2008, BEA was acquired by Oracle. Oracle has integrated the best features of JRockit in JDK8 based on Hotspot.
- Focus on server applications, not too concerned about startup speed, no internal interpreter implementation, all compiled by the just-in-time compiler.
- Billed as the fastest virtual machine in the world, the performance is strong.
- There are also solutions for delay-sensitive applications
"More about JRockit over Real Time"
.
J9
J9 is one of the three commercial VMS. Its full name is IBM Technology for Java Virtual Machine, IT4J for short, and J9 internally.
Similar to HotSpot, it claims to be the fastest in the world (on its own IBM machine).
In 2007, IBM released the J9 VM, named OpenJ9, to be managed by the Eclipse Foundation.
KVM and CDC/CLDC Hotspot
Oracle
在Java ME
Two virtual machines in the product line:CDC/CLDC Hotspot Implementation VM
KVM
是CLDC-HI
The early products- Mainly low-end mobile, simple, lightweight, highly portable
- Intelligent controller, sensor
- Old people mobile phone, function phone
Azul VM
It is a dedicated VIRTUAL machine that is bound to a specific hardware platform and combines hardware and software. It is a fighter in high-performance Java VIRTUAL machine.
Azul VM is a Java virtual machine running on its own dedicated hardware Vega System by Azul System based on Hotspot. Each Azul VM can manage at least dozens of cpus and hundreds of GB of memory, and can implement garbage collectors with controlled GC times in a large memory range.
After 2010, Azul System released the Zing VIRTUAL machine, a general-purpose platform.
BEA Liquid VM
The high-performance Java virtual machine fighter, developed by BEA corporation, runs on its own Hypervisor system.
Liquid VM does not require operating system support and already implements the necessary functions of a dedicated operating system, such as thread scheduling, file systems, network support, and so on. JRockit stopped development, Liquid VM stopped development.
Apache Harmony
Apache has released JDK 1.5, 1.6 compatible Java runtime platform Apache Harmony.
It was jointly developed by IBM and Intel, but suppressed by OpenJDK, and Sun refused to give JCP certification. It was retired in 2011, in which the Java class library code was incorporated into the Android SDK.
Microsoft VM
Microsoft supported Java Applets in Internet Explorer 3, but Sun sued Microsoft for copyright infringement in 1997, and Microsoft removed the Microsoft VM.
Taobao JVM
Launched by Ali, based on OpenJDK Hotspot Vm, transformation, depth customization of a high-performance virtual machine.
- innovative
GCIH (GC Invisible Heap)
Technology, realizedoff-heap
, will have a longer life cycleJava
Objects fromheap
In moving to theheap
Besides, andGC
Can’t manageGCIH
The inside of theJava
Object, loweredGC
Recycle frequency and improveGC
The recovery efficiency of. GCIH
You can have multiple objects inJava
Shared between VM processes.- use
crc32
Order to achieveJVM intrinsic
To reduceJNI
Call overhead of. PMU hardware
的Java profiling tool
And diagnostic assistance- For big data scenarios
ZenGC
Disadvantages: Hardware heavily depends on Intel CPU, loss of compatibility.
Dalvik VM
- Developed by Google and applied to
Android
System, and inThe Android 2.2
Provided in theJIT
. Can only be called virtual machine, notJava VIRTUAL Machine
, not followedJava
Vm specifications. - Cannot execute directly
Java
theclass
File. - Register-based architecture, not stack architecture.
- It’s done after compilation
Dex (Dalvik Executale)
File, execution efficiency is relatively high.dex
Files can be sent throughClass
The file is converted and usedJava
Syntax writing applications can be used directly for mostJava API
. The Android 5.0
Using precompilation (Ahead of Time Compilation
.AOT
)ART VM
replaceDalvik VM
.
PS: Android file. Apk file suffix changed to. Zip, after decompression is a lot of files, of course, including. Dex file.
Graal VM
Philosophy: “Run Program Faster Anywhere.”
- in
Hotspot VM
Based on the enhanced cross-language full stack VIRTUAL machine, can be used as a running platform in any language. - Supports intermixing of interfaces and objects in different languages
- The idea is to convert the source code of these languages, or intermediate formats, through the interpreter into one
Graal VM
Accepted intermediate format. - Real-time compilation optimization can be carried out at run time for better execution efficiency.
Finally: Depending on its implementation, the memory structure of a specific JVM may vary from vendor to vendor or from version to version of the same vendor. Normally we are talking about Hotspot virtual machine.
[Author profile] : Qin Huai, public number [Qin Huai Grocery store] author, the road of technology is not at that time, mountain high water long, even slow, chi and not stop. Personal Writing Direction: Java source code analysis, JDBC, Mybatis, Spring, Redis, distributed, sword Offer, LeetCode, etc., carefully write each article, do not like the title party, do not like the flowery, mostly write a series of articles, can not guarantee that I write are completely correct, But I guarantee that what I write is done through practice or research. We hope to correct any omissions or mistakes.
What did I write about 2020?
Open Source Programming Notes
Weekdays time is precious, I can only use the evening and weekend time to learn writing, pay attention to me, let’s grow together ~