What is Java Virtual Machine in Java Course
The Java Virtual Machine (JVM)
provides a managed runtime environment for secure deployment of
applications with performance that can often exceed native compiled
languages such as C and C++. Memory management with garbage
collection and adaptive compilation by using just in time (JIT)
compilation are the two most prominent features.
Java
course is a most popular, robust, secure, platform independent
and multithreading based high level programming language, because of
this it is preferably used by many programmers.
Although the use of bytecodes
and JIT compilation can provide better peak performance, the warm-up
time required to reach this level may be problematic for certain
application classes.
When the application starts, the
JVM must load and initialize the necessary classes. After this
has been done, the JVM starts execution at the Main () input point.
Because the JVM is a virtual machine, it does not use the same
command set as the physical machine it is running on. It is
therefore necessary to convert the bytecodes of the class files to
the command set of the physical CPU. This is called bytecode
interpretation. This must be repeated for each running byte
code, resulting in much lower performance than a natively compiled
application. This was largely responsible for Java's reputation
when it was first published.
In order to alleviate the
problems when running in interpreted mode, the JVM statistics
internally, how often each method is called. This allows it to
identify Hotspots (hence the name of the Oracle JVM) in the code for
methods that are called repeatedly, such as in a long-running loop.
When the method call count reaches a defined threshold, the JVM
passes the method to an internal compiler called the Just In Time
compiler (often referred to as the JIT).
The compiler used by the JVM at
this stage is called C1 (previously known as the client compiler).
The C1 JIT is designed to generate code as quickly as possible to
quickly improve the performance of these methods. For this
purpose, C1 will only apply the easiest optimizations that do not
require additional profiling data or long time.
This is shown as a green section
in the graph above, with performance gradually improving as more
methods are compiled.
Comments
Post a Comment