JVM 架构 : 运行时数据区 & 内存结构

2021-08-19  本文已影响0人  光剑书架上的书

JVM : Java Virtual Machine 架构

JVM Architecture Runtime Data Area/Memory Structure

Classloader

Class loader is a subsystem in JVM, which is primarily responasible for loading the
java classes, there are 3 different class loaders :

We can also create our own classloader by extending the Classsloader class
Classloader is primarily performs three basic activities, in this order
Loading → Linking - Initialization

JVM 内存区域

Runtime Data Areas(Heap | Method Area | JVM Stacks | PC Register | Native Stacks)

JVM 堆内存区域 Heap

Heap 数据结构

METHOD AREA / PERMANENT

Created at JVM startup and shared among all threads like Heap.

Per Thread Runtime Data Areas : PC Register & Stack Frame

JVM Execute Engine

Interpreter

Interpreter is the one that reads the class files or bytecode and exectutes it
one by one. The problem with the interpreter is that, when a method is
called multiple times, it interprets those lines of bytecode again and again.

JIT compiler

JIT compiler helps in overcoming the problem of the interpreter. When
repeated method calls occur, JIT compiler compiles the bytecode to native
code. This native code will be used directly for repeated method calls .
JIT compiler contains few components to achieve this feature.

Java native method interface

It is responsible for interacting with native libraries and makes it avvailable for
the JVM execution engine.

上一篇下一篇

猜你喜欢

热点阅读