Skip to content

Java Basics(JVM)

Abhishek Khare edited this page Mar 1, 2017 · 7 revisions

Java platform has two components JVM and Java API

JVM ( Java Virtual Machine ): It is a software that cam be ported onto various hardware platforms. And converts Byte codes into machine level language.

  • Java Source Code(.java file) --> Java Compiler(javac/JIT) --> ByteCode(.class file).

  • A JVM converts bytecode into machine level language.

  • A jvm is a runtime environment used to run bytecode generated form the source code.

  • The class file is loaded,converted into machine language and run in the JVM. Each platform has its own kind of JVM.

  1. Class loader : Loads the class files

  2. Class Method Area : All the methods and method data are stored.

  3. HEAP: All the OBJECTS are stored here.

  4. STACK: Java stack stores frames, it holds local variables and partial results and plays a part in method invocation and return values.

  5. PC (Program Counter )Register: Contains address of JVM instructions currently being executed.

  6. Native Method Stack : All native methods used in application.

  7. Execution Engine :

    • A Virtual processor
    • Interpreter ( Reads bytecode streams then executed instruction )
    • JIT Complier (Just In Time)

JIT Compiler : A JIT (Just In Time) Compiler is used to improve the performance. A JIT – Compiler compiles parts of byte code that have similar functionality at the same time, and hence reduces the time needed.

Java API: Application Program Interface.

Garbage Collection

Class Loaders

  1. Boot Strap or System Class Loader:Boot strap is responsible to load the java API classes written by the sun developers. It is responsible to load Jdk’s internal classes.
  2. User defined Class Loader:

Heap and Stack

Clone this wiki locally