当前位置:网站首页>Detailed explanation of findloadedclass
Detailed explanation of findloadedclass
2022-07-03 05:55:00 【Sloppy wandering swordsman】
problem
AClassLoader Of parent by BClassLoader,BClassLoader Of parent by CClassLoader, When AClassLoader call loadClass() Load class , And finally by CClassLoader Loaded classes , Who loaded it ? follow-up AClassLoader When loading the same class again , Whether it can be directly from AClassLoader Of findLoadedClass0() Find the class in and return , Or is it another parental assignment, and finally from CClassLoader Of findLoadedClass0() Find the class in and return ?
SystemDictonary
JVM There's a data structure called SystemDictonary, This structure is mainly used to retrieve the class information we often say , In fact, it is private native final Class<?> findLoadedClass0(String name) The logic of the method
The corresponding structure of these class information is klass, Yes SystemDictonary The understanding of the , You can think of it as a Hashtable
key It's a class loader object + The name of the class ,value It's pointing klass The address of
When any of our class loaders loads classes normally , It's going to come to this SystemDictonary To find the , See if there's one like this klass Can return , If there is, go back to it , Otherwise, it will create a new one and put it into the structure
Initial classloader / Define class loader
In the above class loading problem ,AClassLoader When loading a class, it will delegate to BClassLoader To load the ,BClassLoader When loading a class, it will delegate to CClassLoader To load the , When AClassLoader call loadClass() Load class , And finally by CClassLoader load , Then we call CClassLoader For this class Define class loader ,AClassLoader and BClassLoader For this class Initial classloader
In the process ,AClassLoader、BClassLoader and CClassLoader Will be in SystemDictonary Generate records
Then follow up C The child loader of (AClassLoader and BClassLoader) When loading the same class , You can be in findLoadedClass0() Found this class in , There is no need to entrust upward
边栏推荐
- Today, many CTOs were killed because they didn't achieve business
- Notepad++ wrap by specified character
- [function explanation (Part 1)] | | knowledge sorting + code analysis + graphic interpretation
- The server data is all gone! Thinking caused by a RAID5 crash
- [minesweeping of two-dimensional array application] | [simple version] [detailed steps + code]
- @Import annotation: four ways to import configuration classes & source code analysis
- Final review (Day6)
- Qt读写Excel--QXlsx插入图表5
- Xaml gradient issue in uwp for some devices
- Source insight operation manual installation trial
猜你喜欢

How to create and configure ZABBIX

大二困局(复盘)

为什么网站打开速度慢?

一起上水硕系列】Day 9

Mapbox tasting value cloud animation

2022.DAY592

Alibaba cloud OOS file upload
![[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation](/img/9b/a309607c037b0a18ff6b234a866f9f.jpg)
[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation
![Ensemble, série shuishu] jour 9](/img/39/c1ba1bac82b0ed110f36423263ffd0.png)
Ensemble, série shuishu] jour 9

Apache+PHP+MySQL环境搭建超详细!!!
随机推荐
2022.7.2day594
NG Textarea-auto-resize
@Import annotation: four ways to import configuration classes & source code analysis
[teacher Zhao Yuqiang] Flink's dataset operator
今天很多 CTO 都是被干掉的,因为他没有成就业务
88. 合并两个有序数组
Yum is too slow to bear? That's because you didn't do it
【无标题】
Altaro requirements for starting from backup on Hyper-V
期末复习(DAY6)
为什么网站打开速度慢?
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
Redis cannot connect remotely.
Why should there be a firewall? This time xiaowai has something to say!!!
Communication - how to be a good listener?
Final review Day8
Apple submitted the new MAC model to the regulatory database before the spring conference
Apache+PHP+MySQL环境搭建超详细!!!
[teacher Zhao Yuqiang] Cassandra foundation of NoSQL database
Troubleshooting of 32GB Jetson Orin SOM failure to brush