-
Notifications
You must be signed in to change notification settings - Fork 7
Java Basics(JVM)
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.
-
Class loader : Loads the class files
-
Class Method Area : All the methods and method data are stored.
-
HEAP: All the OBJECTS are stored here.
-
STACK: Java stack stores frames, it holds local variables and partial results and plays a part in method invocation and return values.
-
PC (Program Counter )Register: Contains address of JVM instructions currently being executed.
-
Native Method Stack : All native methods used in application.
-
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
- 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.
- User defined Class Loader:
Heap and Stack
What happens at Object Creation Time
What happens atClass Loading Time