JVM
-
Upload
murali-pachiyappan -
Category
Technology
-
view
154 -
download
1
description
Transcript of JVM
![Page 1: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/1.jpg)
Java Virtual Machine
![Page 2: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/2.jpg)
2
What do you mean by
JVM?
The abstract specification
A concrete implementation
A runtime instance
What is a Java Virtual Machine?
JVM Overview
![Page 3: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/3.jpg)
3
JVM Structure
JVM Overview
![Page 4: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/4.jpg)
4
JVM Architecture
JVM Architecture
![Page 5: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/5.jpg)
5
Class Loader
Class Loader
![Page 6: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/6.jpg)
6
Class Loader Cont..
Class Loader
![Page 7: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/7.jpg)
7
Java Memory Area
Memory Management
![Page 8: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/8.jpg)
8
Java Memory Area Cont..
Memory Management
![Page 9: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/9.jpg)
9
PC Register
Each thread of a running program has its own PC register
PC register is created when the thread is started
As a thread executes a Java method, PC register containsthe instruction currently being executed by the thread
Memory Management
Keeps track of the current instruction executing at any moment
![Page 10: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/10.jpg)
10
JVM Stack
Stack frame: One stack frame is created whenever a method is executed in the JVM, and the stack frame is added to the JVM stack of the thread
Local variable: The parameters sent to the method are saved. After the method parameters, the local variables of the method are saved
Memory Management
Operand stack: An actual workspace of a method. Each method exchanges data between the Operand stack and the local variable array, and pushes or pops other method invoke results
![Page 11: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/11.jpg)
11
Native method stack
In other words, it is a stack used to execute C/C++ codes invoked through JNI
According to the language, a C stack or C++ stack is created
Memory Management
Stack for native code written in a language other than Java
![Page 12: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/12.jpg)
12
Heap
Memory Management
![Page 13: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/13.jpg)
13
Heap
Memory Management
![Page 14: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/14.jpg)
14
Execution Engine
Interpreter: Reads, interprets and executes the bytecode instructions one by one.
JVM Execution engine
JIT compiler: The execution engine runs as an interpreter first, and at the appropriate time, the JIT compiler compiles the entire byte code to change it to native code
![Page 15: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/15.jpg)
15
Execution Engine - JIT Compiler
JVM Execution engine
JIT compiler: The execution engine runs as an interpreter first, and at the appropriate tie, the JIT compiler compiles the entire byte code to change it to native code
![Page 16: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/16.jpg)
Questions ???
![Page 17: JVM](https://reader036.fdocuments.in/reader036/viewer/2022062513/555e26b3d8b42a384f8b4f73/html5/thumbnails/17.jpg)