JVM Tutorials - Herong's Tutorial Examples - v5.13, by Herong Yang
JVM Tutorials - Herong's Tutorial Examples
https://www.herongyang.com/JVM
Copyright © 1997-2024 Herong Yang. All rights reserved.
This book is a collection of notes and sample codes written by the author while he was learning JVM himself. Topics include JVM (Java Virtual Machine) Architecture and Components; Oracle JVM implementation - HotSpot; Eclipse JVM implementation - Eclipse OpenJ9; java.lang.Runtime - The JVM Instance class; Loading Native Libraries; java.lang.System - Representing Operating System; java.lang.ClassLoader - Loading class files; java.lang.Class - Class reflections; Runtime data areas, heap memory and Garbage Collection; Stack, Frame and Stack overflow; Multi-threading impacts on CPU and I/O; CDS (Class Data Sharing); Micro Benchmark tests on different types of operations. Updated in 2024 (Version v5.13) with HotSpot JVM 20.
Table of Contents
JVM (Java Virtual Machine) Specification
What Is JVM (Java Virtual Machine)
JVM Architectures and Components
Implementations of JVM Specification
Java HotSpot VM - JVM by Oracle/Sun
Download and Install JDK on macOS
Download and Install JDK on Windows
Running Java HotSpot Client VM
Running Java HotSpot Server VM
HotSpot Memory Usages on Windows Systems
java.lang.Runtime Class - The JVM Instance
Printing Runtime Basic Information
Running the Garbage Collector Explicitly
Shutting Down or Terminating the JVM Instance
java.lang.System Class - The Operating System
Standard Input, Output, and Error Streams
Current Time in Milliseconds and Nanoseconds
Accessing System Environment Variables
Getting and Adding System Properties
ClassLoader Class - Class Loaders
What Is java.lang.ClassLoader Class
Accessing the ClassLoader of a Class
loadClass() Method - Loading Classes Explicitly
getSystemResource() Method - Finding Files
Class Loading Problem - JAR Hell
ClassChecker.java - Reports Class Loader
ClassChecker.java - Reports Class Locations
"superclass access check failed" Class Load Error
Class Loading Followed by Class Initialization
Class Class - Class Reflections
forName() Method - Loading Classes
Class Reflection and Introspection
Invoking Methods of Class Instances
JVM Stack, Frame and Stack Overflow
Thread Testing Program and Result
CrashThread2.java - Thread Testing Program
Thread Test on HotSpot 1.4 and JRockit 7.0
CPU Impact of Multi-Thread Applications
I/O Impact of Multi-Thread Applications
Micro Benchmark Runner and JVM Options
BenchmarkRunner.java - Benchmark Runner Program
emptyLoop() - The Empty Loop Test Method
"-XX:+PrintCompilation" - Watching JIT Compilation Logs
"-XX:+PrintGC" - Watching GC (Garbage Collection) Logs
"-Xms" and "-Xmx" - Avoiding GC with Large Memory Size
Benchmark Affected by Other Running Applications
"-Xint" - Running in Interpreted-Only Mode
Micro Benchmark Tests on "int" Operations
Micro Benchmark Tests on "long" Operations
Micro Benchmark Tests in JIT Compilation Mode
Micro Benchmark Tests on "float" and "double" Operations
Install OpenJ9 JVM with OpenJDK on CentOS Systems
Footprint Comparison - OpenJ9 vs. HotSpot
Startup Time Comparison - OpenJ9 vs. HotSpot
JRockit JVM 28.2.7 by Oracle Corporation
Downloading and Installing JRockit R28.2.7
Running Java Programs on JRockit R28.2.7
Memory Footprint of JRockit R28.2.7
What Is JRockit Mission Control?
Running JRockit Mission Control
What JRockit Management Console
JRockit Management Console on HotSpot JVM
archived: Download and Install JDK 14 on macOS
Archived: Download and Install Latest JDK 10 on Windows
Archived: Download and Install JDK 1.8.0 on Windows
Archived: Download and Install JDK 1.7.0 on Windows
Archived: Download and Install Java SE 1.6 Update 2
Archived: Installing JRockit JVM 8.0
Archived: Testing with LongWhile.java
Archived: Testing with LongSleep.java
Archived: GCTest.java - Garbage Collection Test Program
Archived: GC Test - Constant Memory Requirement
Archived: GC Test - Periodical Memory Requirement
Archived: GC Test - Releasing Old vs. New Objects
Archived: GC Test - JDK 1.4.0 vs. JDK 1.3.1
Archived: GC Test - Client vs. Server
Archived: StringBuffer Testing Program
Archived: Installing JRockit JVM 7.0
Keywords: JVM, Java, Virtual, Machine