Java Virtual Machine
Java Virtual Machine is a Java Virtual Machine (VM. the concept of VM was first derived from the CPU simulator. It is well known that game machine simulators on PCs use similar technologies as Java VMs. after the java source code is compiled into byte code, it is actually very similar to the machine code, but there is no CPU that can really run such code, so in order to achieve the purpose of running on different platforms, the concept of VM has been vigorously promoted. from a simple perspective, VM is actually translating java bytecode into specific machine code, which is different from the interpreted programming language.
Most of the first-generation VMS adopt direct interpretation, that is, bytecode is translated into machine code in one sentence. however, there is a disadvantage here. In the case of loops, the VM has to translate the translated code again and again. each translation consumes a certain amount of cpu time. therefore, the second generation of VM-JIT (Just In Time Compiler) occurs. It only performs translation when bytecode needs to be translated. how can this problem be achieved? For example, jit vm can convert a bytecode into a machine code and put the code into the buffer. When the running loop is, it will call the translated code repeatedly! The JIT efficiency depends on its ability to analyze repeated calls and minimize the translation workload so that the CPU time can be used to run the program logic.
The third generation VM is hotspot. We will introduce it later.
With the VM, there is a virtual CPU, but we still need some external devices to help complete the computing task, so JNI, its function has different meanings in different occasions. sometimes you can use JNI to directly write a device driver, and sometimes JNI can be used as lightweight wrapper to encapsulate resources of the local system. coupled with the standard library provided by Java itself, VM provides an environment for multiple platform applications! In a system, the JVM is often not unique. If JDK, IE, and Netscape are installed in win32, you may already have three different Virtual machines. as for how your program runs on that VM, it depends entirely on your system settings. generally, if you run the applet, the browser VM will become the default platform. of course, you can replace the ms jvm of IE with jdk plug-in.
Each win32 system contains a MS implement VM. If Java SDK is installed, you can use jview to start VM process from command line. you can run several VMS of the same type or different types on one computer at the same time, each of which runs in an independent process.
Below are some system attributes. You can get some information about the VM!
Use System. getProperty (String propertyName)
ProperyName: meaning:
-----------------------------------------------------
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