当前位置:网站首页>What class loading mechanisms does the JVM have?
What class loading mechanisms does the JVM have?
2022-07-01 22:50:00 【Zhan sir (open source byte)】
JVM What are the class loading mechanisms ?
1、 Overall responsible for , When a classloader is responsible for loading a certain Class when , The Class Other things that are relied on and quoted Class This kind of loader will also be responsible for loading , Unless it is shown that another classloader is used to load
2、 Parent delegation , First let the parent loader try to load the class , Try to load the class from your own classpath only if the parent loader cannot load the class
3、 Caching mechanisms , The caching mechanism will ensure that all loaded Class Will be cached , When you need to use a Class when , The classloader first looks for this... From the cache Class, Only the cache does not exist , The system will read the binary data corresponding to this class , And turn it into Class object , Store in cache . That's why it's modified Class after , Must restart JVM, Changes to the program will take effect
4、 Parent delegate mechanism , If a class loader receives a class load request , It doesn't try to load the class itself first , Instead, the request is delegated to the parent loader to complete , One by one , therefore , All class loading requests should eventually be passed to the top-level boot class loader , Only if the parent loader does not find the required class in its search scope , That is, the load cannot be completed , The child loader will try to load the class by itself .
Parental delegation mechanism process ?
1、 When AppClassLoader Load one class when , It doesn't try to load the class itself first , Instead, delegate the class load request to the parent loader ExtClassLoader To complete .
2、 When ExtClassLoader Load one class when , It doesn't try to load the class itself first , Instead, delegate the class load request to BootStrapClassLoader To complete .
3、 If BootStrapClassLoader Loading failed ( For example, in $JAVA_HOME/jre/lib We didn't find the class), Will use ExtClassLoader To try to load ;
4、 if ExtClassLoader Also failed to load , Will use AppClassLoader To load the , If AppClassLoader Also failed to load , Then an exception will be reported ClassNotFoundException.
If you reprint , Please indicate the source : Open source byte https://sourcebyte.cn/article/174.html
边栏推荐
猜你喜欢

MySQL MHA high availability configuration and failover

删除AWS绑定的信用卡账户

Configure filter

分享一个一年经历两次裁员的程序员的一些感触

104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code

切面条 C语言

Pytorch sharpening chapter | argmax and argmin functions

SAP UI5 应用开发教程之一百零四 - SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目

Understanding of transactions in MySQL

3DE resources have nothing or nothing wrong
随机推荐
Congratulations on the release of friends' new book (send welfare)
3DE 资源没东西或不对
牛客月赛-分组求对数和
cvpr2022 human pose estiamtion
2020-ViT ICLR
Compensation des créneaux horaires
Rust language - Introduction to Xiaobai 05
MySQL stored procedure
MySQL数据库详细学习教程
“信任机器”为发展赋能
twenty million two hundred and twenty thousand seven hundred and one
Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
nn.Parameter】Pytorch特征融合自适应权重设置(可学习权重使用)
MySQL中对于索引的理解
104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code
Operation category read is not supported in state standby
Mysql database detailed learning tutorial
Cloud Vulnerability Global Database
internal field separator
The fixed assets management subsystem reports are divided into what categories and which accounts are included