JVM Tutorials - Herong's Tutorial Examples

http://www.herongyang.com/JVM

Copyright © 2018 by Dr. Herong Yang. All rights reserved.

JVM Tutorials 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), HotSpot, Class Loader, Reflection, Heap, Stacks, GC (Garbage Collection), CDS (Class Data Sharing), Multi-Thread, Micro Benchmark.

Table of Contents

About This Book

JVM (Java Virtual Machine) Specification

What Is JVM (Java Virtual Machine)

What Is JVM Specfication

JVM Architectures and Components

Implementations of JVM Specfication

Java HotSpot VM - JVM by Oracle/Sun

What Is HotSpot JVM

Download and Install Latest JDK on Windows

Running Java HotSpot Client VM

Running Java HotSpot Server VM

HotSpot Memory Usages on Windows Systems

Download and Install JDK 1.8.0 on Windows

Download and Install JDK 1.7.0 on Windows

java.lang.Runtime Class - The JVM Instance

What Is Runtime?

Printing Runtime Basic Information

Running the Garbage Collector Explicitly

Shutting Down or Terminating the JVM Instance

Executing System Commands

Loading Native Libraries

java.lang.System Class - The Operating System

What Is java.lang.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 Class Loader

What Is java.lang.ClassLoader Class

Accessing the ClassLoader of a Class

JVM "-verbose:class" Option

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

What Is java.lang.Class Class

forName() Method - Loading Classes

Class Reflection and Introspection

Array Class Introspection

Invoking Methods of Class Instances

JVM Runtime Data Areas

JVM Stack, Frame and Stack Overflow

Thread Testing Program and Result

CrashThread2.java - Thread Testing Program

Thread Test on HotSpot JVM 10

Thread Test on HotSpot 1.7

Thread Test on JRockit 28.7

Thread Test on HotSpot 1.4 and JRockit 7.0

Thread Test on HotSpot 1.6

CPU Impact of Multi-Thread Applications

I/O Impact of Multi-Thread Applications

CDS (Class Data Sharing)

Micro Benchmark Runner and JVM Options

What Is Micro Benchmark?

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

JRockit JVM 28.2.7 by Oracle Corporation

What Is JRockit JVM?

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

Outdated Tutorials

Outdated: Download and Install Java SE 1.6 Update 2

Outdated: Installing JRockit JVM 8.0

Outdated: Testing with LongWhile.java

Outdated: Testing with LongSleep.java

Outdated: GCTest.java - Garbage Collection Test Program

Outdated: GC Test - Constant Memory Requirement

Outdated: GC Test - Periodical Memory Requirement

Outdated: GC Test - Releasing Old vs. New Objects

Outdated: GC Test - JDK 1.4.0 vs. JDK 1.3.1

Outdated: GC Test - Client vs. Server

Outdated: StringBuffer Testing Program

Outdated: Installing JRockit JVM 7.0

Outdated: Running JRockit JVM with Management Console

References

Full Version in PDF/EPUB

Keywords: JVM, Java, Virtual, Machine