当前位置:网站首页>JVM class loading mechanism
JVM class loading mechanism
2022-07-07 20:00:00 【Whiteye too white】
Class loading mechanism
load —> Connect ( verification -> Get ready -> analysis )—> initialization —> Use —> uninstall
1. load
- Get the binary byte stream defining this class through the full class name
- Convert the static storage structure represented by the byte stream to the runtime data structure of the method area
- Generate an in memory... That represents the class Class object , As the access to the data in the method area
2. verification
- class File format validation :class Document specification
- Metadata validation : Semantic analysis , Compliance java language norm
- Bytecode verification : Operation instruction is legal
- Symbol reference validation : Ensure that the parsing action is executed correctly
3. Get ready
Allocate memory for static variables of a class , And initialize it to the default value .
( It's not the initial value ,final Static constants decorated with keywords are directly assigned initial values , Load into the method area runtime constant pool .)
4. analysis
The process of replacing a symbolic reference in a constant pool with a direct reference .
5. initialization
Give the class the correct initial value for its static variables ,JVM Responsible for class initialization , Class variables are mainly initialized .
Initialization class triggers : new Instance object 、 Accessing static variables of a class 、 Calling static methods of a class 、 Reflection calls class 、 When subclasses need to be initialized, initialize the parent class first ( Same interface )、mian Method class .
6. uninstall
- All instance objects of this class have been GC, In other words, there is no instance object of this class in the heap .
- This class is not referenced anywhere .
- An instance of the class loader for this class has been GC.
边栏推荐
- pom.xml 配置文件标签:dependencies 和 dependencyManagement 区别
- R语言ggplot2可视化:使用ggpubr包的ggecdf函数可视化分组经验累积密度分布函数曲线、linetype参数指定不同分组曲线的线型
- 831. KMP字符串
- PMP对工作有益吗?怎么选择靠谱平台让备考更省心省力!!!
- 九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
- JVM 类加载机制
- 编译器优化那些事儿(4):归纳变量
- 微信公众号OAuth2.0授权登录并显示用户信息
- R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
- Version selection of boot and cloud
猜你喜欢
Cloud 组件发展升级
vulnhub之tre1
Simulate the implementation of string class
微信公众号OAuth2.0授权登录并显示用户信息
J ü rgen schmidhub reviews the 25th anniversary of LSTM papers: long short term memory All computable metaverses. Hierarchical reinforcement learning (RL). Meta-RL. Abstractions in generative adversar
Welcome to the markdown editor
【RT-Thread env 工具安装】
PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
2022如何评估与选择低代码开发平台?
Matplotlib drawing 3D graphics
随机推荐
A pot of stew, a collection of common commands of NPM and yarn cnpm
【剑指offer】剑指 Offer II 012. 左右两边子数组的和相等
R语言ggplot2可视化:使用ggpubr包的ggdensity函数可视化分组密度图、使用stat_overlay_normal_density函数为每个分组的密度图叠加正太分布曲线
【RT-Thread env 工具安装】
Mysql, sqlserver Oracle database connection mode
Semantic slam source code analysis
多个线程之间如何协同
强化学习-学习笔记8 | Q-learning
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
Introduction to bit operation
网信办公布《数据出境安全评估办法》,9 月 1 日起施行
Sword finger offer II 013 Sum of two-dimensional submatrix
MSE API学习
What does "true" mean
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
MySQL、sqlserver oracle数据库连接方式
PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
一锅乱炖,npm、yarn cnpm常用命令合集
CSDN语法说明