0
点赞
收藏
分享

微信扫一扫

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

JVM : Java Virtual Machine 架构


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

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

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


JVM Architecture Runtime Data Area/Memory Structure


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

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

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

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


Classloader

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

  • Bootstrap Classloader is the super class loader, which primharily loads the rt.jar,
    which contains the java.lang, java.net, java.io, java.sql package classes
  • Extension Classloader is the sub of Bootstrap Classloader, it loads the library
    under JRE_HOME/lib/ext directory
  • System/Application Classloader is the sub of ExtenstionClassloader, it loads the
    classes from the classpath, specified using the java -cp comrmand.

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 架构 : 运行时数据区 & 内存结构_jdk_08

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

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


JVM 内存区域


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

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


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


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

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


JVM 堆内存区域 Heap


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


Heap 数据结构


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


METHOD AREA / PERMANENT

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


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


Per Thread Runtime Data Areas : PC Register & Stack Frame

  • Local Variable Array
  • Operand Stack
  • Reference to Constant Pool

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

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


JVM Execute Engine


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

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

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


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.


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


Java native method interface

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


举报

相关推荐

0 条评论