Execution Engine in Java Last Updated : 17 May, 2020 Comments Improve Suggest changes Like Article Like Report Java virtual machine or JVM can be visualized as a virtual machine residing in the computer that provides an environment for the code to get executed. Java Runtime Environment or JRE is an implementation of the JVM. In order to execute the code, an execution engine is used. In this article, let's understand the execution engine and different components in it. The execution engine is the Central Component of the java virtual machine(JVM). It communicates with various memory areas of the JVM. Each thread of a running application is a distinct instance of the virtual machine’s execution engine. Execution engine executes the byte code which is assigned to the run time data areas in JVM via class loader. Java Class files are executed by the execution engine. Execution Engine contains three main components for executing Java Classes. They are: Interpreter: It reads the byte code and interprets(convert) into the machine code(native code) and executes them in a sequential manner. This component runs the application from the command line by accepting a filename argument. The problem with the interpreter is that it interprets every time, even the same method multiple times, which reduces the performance of the system. To overcome this problem JIT Compilers is introduced in 1.1 version. JIT Compiler: JIT compiler counterbalances the interpreter’s disadvantage of slow execution and improves the performance. At run time, the JVM loads the class files, the semantic of each is determined and appropriate computations are performed. The additional processor and memory usage during interpretation makes a Java application perform slowly as compared to a native application. The JIT compiler aids in improving the performance of Java programs by compiling bytecode into native machine code at run time. The JIT compiler is enabled throughout, while it gets activated when a method is invoked. For a compiled method, the JVM directly calls the compiled code, instead of interpreting it. Theoretically speaking, If compiling did not require any processor time or memory usage, the speed of a native compiler and that of a Java compiler would have been same. JIT compilation requires processor time and memory usage. When the java virtual machine first starts up, thousands of methods are invoked. Compiling all these methods can significantly affect startup time, even if the end result is a very good performance optimization. Profiler: This is a tool which is the part of JIT Compiler is responsible to monitor the java bytecode constructs and operations at the JVM level. Garbage Collector: This is a program in java that manages the memory automatically. It is a daemon thread which always runs in the background. This basically frees up the heap memory by destroying unreachable methods. Java Native Interface(JNI): JNI acts as a bridge(mediator) between java method calls and corresponding native libraries. That is: Comment More infoAdvertise with us Next Article Execution Engine in Java gauravmoney26 Follow Improve Article Tags : Java java-basics java-garbage-collection java-JVM Practice Tags : Java Similar Reads Java Exception Handling Exception handling in Java allows developers to manage runtime errors effectively by using mechanisms like try-catch block, finally block, throwing Exceptions, Custom Exception handling, etc. An Exception is an unwanted or unexpected event that occurs during the execution of a program, i.e., at runt 10 min read Introduction to Java Java is a high-level, object-oriented programming language developed by Sun Microsystems in 1995. It is platform-independent, which means we can write code once and run it anywhere using the Java Virtual Machine (JVM). Java is mostly used for building desktop applications, web applications, Android 4 min read Compilation and Execution of a Java Program Java, being a platform-independent programming language, doesn't work on the one-step compilation. Instead, it involves a two-step execution, first through an OS-independent compiler; and second, in a virtual machine (JVM) which is custom-built for every operating system. The two principal stages ar 5 min read Nashorn JavaScript Engine in Java with Examples Nashorn: Nashorn is a JavaScript engine which is introduced in JDK 8. With the help of Nashorn, we can execute JavaScript code at Java Virtual Machine. Nashorn is introduced in JDK 8 to replace existing JavaScript engine i.e. Rhino. Nashorn is far better than Rhino in term of performance. The uses o 4 min read Compiler Class in Java Compiler Class provides support and related services to Java code to Native Code. Native code is a form of code that can be said to run in a virtual machine (for example, [JVM]Java Virtual Machine). Declaration: public final class Compiler extends ObjectMethods of Java Compiler Class 1. command() T 2 min read File canExecute() method in Java with Examples The canExecute() function is a part of File class in Java. This function determines whether the program can execute the specified file denoted by the abstract pathname. If the file path exists and the application is allowed to execute the file, this method will return true. Else it will return false 2 min read Learn Java - A Beginners Guide for 2024 If you are new to the world of coding and want to start your coding journey with Java, then this learn Java a beginners guide gives you a complete overview of how to start Java programming. Java is among the most popular and widely used programming languages and platforms. A platform is an environme 10 min read Difference between ExecutorService execute() and submit() method in Java The ExecutorService interface extends Executor by adding methods that help manage and control the execution of threads. It is defined in java.util.concurrent package. It defines methods that execute the threads that return results, a set of threads and that determine the shutdown status. In this art 4 min read Interesting Facts About Java Java: A general-purpose, high-level programming language. It is developed by Sun Microsystems. It was developed by a mini team of engineers which is known as the Green Team. They initiated this language in 1991. Here are some interesting facts about Java: The initial name of java was "Oak". It was c 2 min read Introduction to Java Agent Programming Java agents are a part of the Instrumentation API in Java, which allows developers to modify the behavior of a running application by altering its bytecode. This process, known as instrumentation, does not require changes to the source code. Java agents are a powerful feature that can be used for pe 7 min read Like