当前位置:网站首页>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 .
边栏推荐
- 数据查询WHERE
- A super easy-to-use artifact apifox, throw swagger a few streets... (glory Collection Edition)
- Examples of ThreadLocal usage scenarios under multithreading
- 回溯——第51题. N皇后——必须攻克的经典回溯难题
- 笔记。。。。
- Tencent cloud and smart industry business group (CSIG) adjusted the organizational structure and established the digital twin product department
- JDBC gets connections from the connection pool (Druid connection pool)
- Huawei ultra fusion fusioncube solution notes
- Interviewer: how to understand QPS, TPS, RT?
- LCD notes (5) LCD driver framework_ Use device tree
猜你喜欢

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

Today's sleep quality record 75 points

LCD笔记(4)分析内核自带的LCD驱动程序

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

0 basic programming resources (collect first ~ read slowly ~)

Various extensions of hcip-9.ospf

回溯——第51题. N皇后——必须攻克的经典回溯难题

2022 年要了解的新兴安全供应商

C#把Type当做泛型T,来作为方法的泛型进行使用

Transformer dominates the world? Depth wise conv has something to say
随机推荐
RMII, smii, gmii, rgmii interfaces of Ethernet Driver
Food safety | is self-made food purchased online healthy food? Don't fall into these misunderstandings
How to optimize a large number of if else [email protected] Detailed explanation of valib
Does anyone know where the retract of flinksql can be specified? Only api code settings can be seen in online materials
酷早报:7月25日Web3加密行业新闻大汇总
Kubernetes----PV和PVC的生命周期简介
数字化时代,是什么“黄金宝藏”在推动百年药企发展?
From January to June, China's ADAS suppliers accounted for 9%, and another parts giant comprehensively laid out the new smart drive track
Display inline+calc realizes left, middle and right layout, and the middle is adaptive
mqtt send receive
LCD笔记(4)分析内核自带的LCD驱动程序
笔记。。。。
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?
二叉树的初阶笔记
jvm:类加载子系统干什么的?由什么组成?需要记住哪些八股文?
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
Kubernetes----Kubernetes常用插件简介
HCIP-9.OSPF的各种拓展
The strongest tool class of entity mapping: mapstruct Zhenxiang
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