当前位置:网站首页>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.
边栏推荐
- LeetCode_7_5
- 编译器优化那些事儿(4):归纳变量
- How to cooperate among multiple threads
- 让这个 CRMEB 单商户微信商城系统火起来,太好用了!
- 线性基
- # 欢迎使用Markdown编辑器
- 爬虫实战(七):爬王者英雄图片
- Kirin Xin'an joins Ningxia commercial cipher Association
- The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
- 怎么在手机上买股票开户 股票开户安全吗
猜你喜欢

LeetCode_7_5

vulnhub之school 1

Cloud 组件发展升级

Ways to improve the utilization of openeuler resources 01: Introduction

使用高斯Redis实现二级索引

Openeuler prize catching activities, to participate in?

一张图深入的理解FP/FN/Precision/Recall

AD域组策略管理

Detailed explanation of Flink parallelism and slot

PMP practice once a day | don't get lost in the exam -7.7
随机推荐
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
Semantic slam source code analysis
Detailed explanation of Flink parallelism and slot
Sword finger offer II 013 Sum of two-dimensional submatrix
Implement secondary index with Gaussian redis
My creation anniversary
模拟实现string类
Make this crmeb single merchant wechat mall system popular, so easy to use!
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
2022年投资哪个理财产品收益高?
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
【STL】vector
【Confluence】JVM内存调整
银行理财产品怎么买?需要办银行卡吗?
Is PMP beneficial to work? How to choose a reliable platform to make it easier to prepare for the exam!!!
ant desgin 多选
ASP.NET幼儿园连锁管理系统源码
Kunpeng developer summit 2022 | Kirin Xin'an and Kunpeng jointly build a new ecosystem of computing industry
2022如何评估与选择低代码开发平台?
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」