当前位置:网站首页>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
边栏推荐
猜你喜欢

Fully annotated SSM framework construction

C#/VB.NET 给PDF文档添加文本/图像水印

SAP 智能机器人流程自动化(iRPA)解决方案分享

数字货币:影响深远的创新

元宇宙可能成为互联网发展的新方向

Today's sleep quality record 71 points

Appium自动化测试基础 — 补充:Desired Capabilities参数介绍

Mysql5.7 set password policy (etc. three-level password transformation)

Cut noodles C language

正则系列之量词(Quantifiers)
随机推荐
C#/VB. Net to add text / image watermarks to PDF documents
Mysql5.7 set password policy (etc. three-level password transformation)
MySQL中对于索引的理解
SAP 智能机器人流程自动化(iRPA)解决方案分享
twenty million two hundred and twenty thousand seven hundred and one
[literacy] deep / shallow, local / global features in machine learning image processing
MySQL stored procedure
There is no signal in HDMI in computer games caused by memory, so it crashes
Kubernetes创建Service访问Pod
The fixed assets management subsystem reports are divided into what categories and which accounts are included
Deep learning -- data operation
【日常训练】326. 3 的幂
“信任机器”为发展赋能
Origin2018 installation tutorial "recommended collection"
MySQL5.7 设置密码策略(等保三级密码改造)
Pytorch nn. functional. Simple understanding and usage of unfold()
内部字段分隔符
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条
小红书Scheme跳转到指定页面
internal field separator