JVM 架构 : 运行时数据区 & 内存结构
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 :
- 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 内存区域
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
- Local Variable Array
- Operand Stack
- Reference to Constant Pool
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.
相关文章
- 不懂优雅停机,搞挂了线上服务该咋办?
- 如何在 Ubuntu Linux 中正确地设置 JAVA_HOME 变量
- 如何在 Linux 上手动安装 Java
- 如何在 Ubuntu 中运行 Java 程序
- HarmonyOS使用Java获取位置信息
- 如何在 Fedora Linux 上安装 Java
- HarmonyOS基于Java开发的服务卡片
- 《漫谈 MQ》设计 MQ 的 3 个难点
- Java开发日常
- 手把手教你提交Jar包到Maven公共仓库 | 萌新写开源02
- 一次完整的JVM堆外内存泄漏故障排查记录
- elasticsearch之自定义Java代码的安全策略管理
- Java中的受检异常
- 并发编程之对象的发布和逸出
- 并发编程之内存可见性
- 并发编程之线程安全性
- 并发编程的几种形式
- 并发编程简介
- 使用Ant自动化我们的java项目生成
- Java构建工具Ant小记(一)