JVM Part 2 Class Loading Subsystem

JVM mainly includes two modules, the class loading subsystem and the execution engine. This blog will summarize the class loading subsystem.

Table of contents

1. Class loading subsystem function

2. Class loading subsystem execution process

2.1 Loading

2.2 Links

 2.3 Initialization

 3. Class loader classification

 3.1 Boot class loader

 3.2 Custom loader

 3.2.1 Custom loader implementation stepsEdit

 4. Class loader features

4.1 Parental Delegation

4.2 Sandbox security mechanism


1. Class loading subsystem function

2. Class loading subsystem execution process

2.1 Loading

 

Common tools for parsing class files (bytecode tools)

2.2 Links

 2.3 Initialization

Code demo:

Note: Each class can only be loaded once

 

 3. Class loader classification

    Generally speaking, Java supports two types of class loaders, bootstrap class loaders and custom loaders.

 

 

 Code demonstration to obtain class loader

 3.1 Boot class loader

 3.2 Custom loader

 

 

Code demo:
 

 3.2.1 Custom loader implementation steps

 Code demo:

 ClassLoader class introduction:

 

 

 4. Class loader features

4.1 Parental Delegation

 

 

 

 Benefits of parent delegation mechanism:

4.2 Sandbox security mechanism

 

 

 

Guess you like

Origin blog.csdn.net/hsy12342611/article/details/132524380