当前位置:网站首页>JVM: what does the class loading subsystem do? What is it made of? What eight part essay do you need to remember?
JVM: what does the class loading subsystem do? What is it made of? What eight part essay do you need to remember?
2022-07-26 12:58:00 【Gu Gugu】
jvm: What does the class loading subsystem do ? What makes up ? What eight part essay need to be remembered ?
I just worked recently , A little slack , Tiktok , I found that everyone is learning jvm, It happens that Goo Goo has always wanted to learn something in this regard , Just refer to others , To study the b Station Shang Silicon Valley teacher Kang's video , It's really very detailed . I plan to read and record a little .
Recently I finished reading the front 30 Multiple video screens , Mainly about the class loading subsystem .
A little bit jvm, Will know jvm It mainly includes class loading subsystem , Run time data area , And the execution engine .
Here's the catalog title
Three level directory

Here I want to say
Class loading subsystem functions :
From the file system , load class file , Load only , No matter what .
Someone asked : Written java How can a file become class The file ?
answer : adopt javac command
The class loading subsystem includes :
loading-linking-initializetion The three step
loading
You need to know that bootstrap-extension-application Three loaders
By full class name , Get the binary byte stream of this class =》 The data structure of the method area generates the class in memory class object .linking
Need to know validation , Get ready , Analysis of the three step ( Just feel understood )init
javac Automatically collect the assignment actions of all class variables in the class Clinnit
1. What are the loaders “?
Class loader ( important )
bootstrap Boot class loader , use c or c++, For loading ,java,javax,sun The files under the package .
Other loaders ( important )
extension Extended class loader , and application System class loaders are collectively referred to as other loaders .
Generally, our own classes are written with application Loaded , and jre,lib,ext Some files under the subdirectory are loaded with extension classes .
We can get the system class loader in the following way ,.getParent Get his top .
ClassLoader.getSystemClassLoader()
2. You can also customize the classloader - benefits :
- Isolation loading class
- Modify the class loading method
- Extended load source
- Prevent source code leakage
Method :extends classloader rewrite findclass
3. Parent delegate mechanism ( important )
- If a classloader receives a load request , It doesn't load itself first , Instead, delegate the request to the parent loader to execute .
- If the delegated parent loader , There is a parent class loader , It will further entrust upward , Total point , Top level boot loader ,
- If the parent class can finish loading, let the parent class load , If it doesn't load , Then the subclass is loaded .

The advantages of parental delegation : - Avoid duplicate loading of classes
- Protect program security , Prevention core api Be tampered with at will ,( For example, custom String class )
4. Sandbox security mechanism
- Protect the code loaded by your bootstrap class , Do not break custom code
- The class name and the loader used are the same , Can be defined as a class ( Is the class name of a class , Just like the loader that loads it , It's a class )
- jvm It will protect a boot message of the user class loader , Method to area , For subsequent references
Active and inactive use of class : Do not initialize .
So you can still see the bold places , It's always good to have a little reflection on the eight part essay .
边栏推荐
- 维度灾难 维数灾难 暂记
- RMII, smii, gmii, rgmii interfaces of Ethernet Driver
- Interview JD T5, was pressed on the ground friction, who knows what I experienced?
- Code examples explain the difference between [reentrant lock] and [non reentrant lock]?
- In the digital era, what "golden treasure" is driving the development of pharmaceutical enterprises for a century?
- 数据查询WHERE
- What is the Internet of things? The most comprehensive explanation of common IOT protocols
- 食品安全 | 网购的自制食品就是健康食品?莫要陷入这些误区
- 可移动表空间
- Azure Synapse Analytics 性能优化指南(2)——使用具体化视图优化性能(上)
猜你喜欢

The best engineer was "forced" away by you like this!

论文阅读-MLPD:Multi-Label Pedestrian Detector in Multispectral Domain(海康威视研究院实习项目)

Food safety | these common foods are poisonous! Check your dining table quickly

STM32 drives hc05 Bluetooth serial port communication module

Knowledge points of C language documents

C语言文件知识点

PXE principle and configuration

Food safety | can you eat any fruit?

Huawei recruited "talented teenagers" twice this year; 5.4 million twitter account information was leaked, with a selling price of $30000; Google fired engineers who believed in AI consciousness | gee

笔记。。。。
随机推荐
数据查询函数
Flutter integrated Aurora push
高通再次「押宝」中科创达,挑战智能驾驶软硬件全栈方案
【TypeScript】TypeScript常用类型(上篇)
MySQL可以自定义变参存储函数吗?
Where is safe to open an account when buying stocks on mobile phones?
Interview JD T5, was pressed on the ground friction, who knows what I experienced?
如何以文本形式查看加密过的信息
JDBC从连接池获取连接(Druid连接池)
火山引擎云上增长方案全景:30+方案齐出,兵发优势领域
Shell变量和引用
Version of NDK matched the requested version 21.0.6113669. versions available locally: 2
Guys, how can CDC Oracle set the reading from the specified SCN number, or how to set the read-only full archive, not to read fast
数据库组成视图
LCD笔记(4)分析内核自带的LCD驱动程序
食品安全 | 这些常见食物小心有毒!速查自家餐桌
数字化时代,是什么“黄金宝藏”在推动百年药企发展?
Understand test.py in gaitset
一文看懂GaitSet中的test.py
Azure Synapse Analytics 性能优化指南(2)——使用具体化视图优化性能(上)