西维蜀黍

【Java】JVM-自定义类加载器

自定义类加载器中的方法

findClass()

findClass() 方法是自定义类加载器类必须重写(override)的方法,用于告诉自定义类加载器到哪里去加载类,比如某个目录或者 JAR URL等。参数name 为要加载的类全名,如 java.lang.String。

  ...


【Java】JVM - JVM 内存区域(Memory Area)

JVM 内存区域

JVM 内存区域 主要由**运行时数据区域(Runtime data area)、类加载器子系统(Class Loader Subsystem)执行引擎(Execution Engine)**组成。

  ...


【Java】JVM - 类加载机制(Class Load Mechanism)

背景

虚拟机把描述类的数据从 Class 文件加载到内存,并对数据进行校验、转换解析和初始化,最终形成可以被虚拟机直接使用的 Java 类型,这就是虚拟机的类加载机制(ClassLoad Mechanism)

  ...


【Java】JVM-类加载器(Class Loader)

类加载器(Class Loader)

在 Java 中,默认提供的三种类加载器,分别是 BootStrapClassLoader(启动类加载器)、ExtClassLoader(扩展类加载器)、AppClassLoader(应用程序类加载器)。

同时,我们也可以定义自己的类加载器 (CustomClassLoader),那么它的 parent 肯定就是 AppClassLoader(应用程序类加载器)了。类加载器的这种层次关系称为双亲委派模型(Parents Delegation Model)

  ...


【Java】JVM 入门

前言

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

The JVM reference implementation is developed by the OpenJDK project as open source code and includes a JIT compiler called HotSpot. The commercially supported Java releases available from Oracle are based on the OpenJDK runtime. Eclipse OpenJ9 is another open source JVM for OpenJDK.

  ...