当前位置:网站首页>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
边栏推荐
猜你喜欢
【无标题】
447 Bili Bili noodles warp 1
3DE 资源没东西或不对
How to write a performance test plan
转--原来gdb的底层调试原理这么简单
使用 EMQX Cloud 实现物联网设备一机一密验证
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条
Slope compensation
SAP 智能机器人流程自动化(iRPA)解决方案分享
Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
随机推荐
今日睡眠质量记录71分
正则系列之量词(Quantifiers)
Redis configuration and optimization
MySQL数据库详细学习教程
SAP 智能机器人流程自动化(iRPA)解决方案分享
Sogou wechat app reverse (II) so layer
SAP intelligent robot process automation (IRPA) solution sharing
Mysql database detailed learning tutorial
How to write a performance test plan
Understanding of inverted residuals
Cut noodles C language
Slope compensation
隐藏用户的创建和使用
Pytorch sharpening chapter | argmax and argmin functions
微信开放平台扫码登录[通俗易懂]
Appium automated testing foundation - Supplement: introduction to desired capabilities parameters
Favorite transaction code management tool in SAP GUI
Awoo's favorite problem (priority queue)
Using securecrtportable to remotely connect virtual machines
[literacy] deep / shallow, local / global features in machine learning image processing