Java is a computer programming language that is used to build softwares. It is also an application, development, and deployment environment. Java is object oriented programming language to help us visualize the program in real-life terms. The syntax of Java is similar to C and C++ based language. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture.
Showing posts with label JVM. Show all posts
Showing posts with label JVM. Show all posts
Java Virtual Machine (JVM)
A Java virtual machine is a software that is capable of executing Java bytecode. Code for the JVM is stored in .class or .jar files, each of which contains code for at most one public class. JVM enables the Java application to be platform independent. JVM is distributed along with a set of standard class libraries that implement the Java application programming interface (API). JVM mainly performs three tasks:
Loads Code The class loader loads all classes needed for the execution of a program.
Verifies Code The byte code verifier tests format of code fragment and checks code fragments for illegal code, which is code that forges pointers, violates access rights on objects, or attempts to change object type.
Execute Code Performed by the runtime interpreter.
The Java Runtime Environment(JRE) is an implementation of the Java Virtual Machine (JVM), which actually executes Java programs. The Java Development Kit (JDK) is the original Java development environment for Java programmers. The JDK consists of a library of standard classes and a collection of utilities for building, testing, and documenting Java programs.
Loads Code The class loader loads all classes needed for the execution of a program.
Verifies Code The byte code verifier tests format of code fragment and checks code fragments for illegal code, which is code that forges pointers, violates access rights on objects, or attempts to change object type.
Execute Code Performed by the runtime interpreter.
The Java Runtime Environment(JRE) is an implementation of the Java Virtual Machine (JVM), which actually executes Java programs. The Java Development Kit (JDK) is the original Java development environment for Java programmers. The JDK consists of a library of standard classes and a collection of utilities for building, testing, and documenting Java programs.
Java Automatic Memory Management | Java Coding
Automatic Memory Management:
Many programming languages like C and C++ permit the memory to be allocated dynamically at runtime. After the allocated memory is no longer required, the program or runtime environment should de-allocated the memory. If the program does not de-allocate the memory that can crash eventually when there is no memory left for the system to allocate. These types of programs are said memory leaks. Java overcome this problem by using garbage collection. It provides a system level thread that tracks each memory allocation. During idle cycles in the JVM, the garbage collection thread checks for and frees any memory the can be freed in the object lifecycle.
Subscribe to:
Posts (Atom)