当前位置:网站首页>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 .
边栏推荐
- Various extensions of hcip-9.ospf
- Yolov7 training dangerous goods identification pytorch
- mqtt send receive
- If there is a declaration "int x=5, y=1;", Then the expression x < y? The result of x++: y++ is:
- StreamNative 团队文化:一家“透明”的公司
- Backtracking - 491. Incremental subsequence
- 酷早报:7月25日Web3加密行业新闻大汇总
- 数据库组成存储过程和函数
- Kubernetes----PV和PVC的生命周期简介
- LCD笔记(6)LCD驱动程序框架_配置引脚
猜你喜欢

Industry case | how does the index help the sustainable development of Inclusive Finance in the banking industry

The programmed navigation route jumps to the current route (the parameters remain unchanged), and if it is executed multiple times, it will throw a navigationduplicated warning error?

Interview JD T5, was pressed on the ground friction, who knows what I experienced?

0基础编程资源大全(先收藏~慢慢看~)

Backtracking - 46. Full arrangement
2022 employment season! Adobe helps creative industry workers break through the shackles of skills and return to the source of ability

What is the Internet of things? The most comprehensive explanation of common IOT protocols

食品安全 | 随便果可以”随便“吃吗?

UE5 官方案例Lyra 全特性详解 7.资源管理

Various extensions of hcip-9.ospf
随机推荐
Code error reporting and problem solving experience II: test error reporting in yolov5
回溯——131. 分割回文串
Use flex to realize left middle right layout and middle adaptation
MySQL可以自定义变参存储函数吗?
Display inline+calc realizes left, middle and right layout, and the middle is adaptive
Bitwise and how to write SQL
jvm:类加载子系统干什么的?由什么组成?需要记住哪些八股文?
“2022华为开发者大赛中国区东部赛区开幕式”在福州成功举办
一文看懂GaitSet中的test.py
Kubernetes---- installing and deploying NFS servers
数字化时代,是什么“黄金宝藏”在推动百年药企发展?
历史上的今天:IBM 获得了第一项专利;Verizon 收购雅虎;亚马逊发布 Fire Phone...
Detailed explanation of redis's single login
论文阅读-MLPD:Multi-Label Pedestrian Detector in Multispectral Domain(海康威视研究院实习项目)
Where is safe to open an account when buying stocks on mobile phones?
关于图片地址链接复制问题
V00 - do whatever you want when you are old
LCD notes (4) analyze the LCD driver of the kernel
Use grid to realize left, middle and right layout, and the middle content is adaptive
Data query of MySQL (aggregate function)