𝔖 Scriptorium
✦   LIBER   ✦

📁

JVM Performance Engineering: Inside OpenJDK and the HotSpot Java Virtual Machine

✍ Scribed by Monica Beckwith


Publisher
Addison-Wesley Professional
Year
2024
Tongue
English
Leaves
397
Series
Developer's Library
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Peek Under the Hood of the Complex but Fascinating Java Virtual Machine

Dive into the intricacies of JVM performance with JVM Performance Engineering, the essential guide for seasoned Java developers eager to demystify the JVM. Focusing on the OpenJDK HotSpot VM, this book provides insights into cutting-edge Java performance techniques and trends.

Distinguished Java Champion Monica Beckwith blends theoretical insights and practical tools--encompassing case studies, applications, use-case diagrams, and process flow charts--to demonstrate diagnostic techniques, performance methodologies, and optimizations.

This manual is a portal to excelling in Java performance engineering, offering Java developers, system architects, and software engineers the tools to foster career advancement and success with Java applications.

  • Examine the evolving Java type system, from lambda expressions to the advent of records and sealed classes, and explore how Project Valhalla aims to further optimize performance
  • Leverage the Unified JVM Logging Interface for enhanced diagnostics, monitoring, and performance testing, featuring the novel asynchronous logging mechanism
  • Grasp the intricate relationship between JVM and hardware, mastering end-to-end Java performance optimization techniques
  • Gain deep insights into JVM's garbage collection and memory management, examining the pivotal Garbage First and Z GCs--and how they are shaping the Java performance landscape
  • Explore efficient deployment strategies and techniques to accelerate JVM readiness, leveraging class data sharing, ahead-of-time compilation, and innovations like GraalVM and upcoming Project Leyden
  • Embark on an exploration of the synergy between the JVM and exotic hardware like GPUs and FPGAs and revel in the potential of Project Panama and TornadoVM in high-computational scenarios such as machine learning and data analytics
  • Look ahead to the future of Java concurrency with Virtual Threads, and investigate runtime optimizations of string handling and concurrency, propelling Java forward

Register your product for convenient access to downloads, updates, and/or corrections as they become available. See inside for details.

✦ Table of Contents


Cover
Half Title
Title Page
Copyright Page
Contents
Preface
Acknowledgments
About the Author
1 The Performance Evolution of Java: The Language and the Virtual Machine
A New Ecosystem Is Born
A Few Pages from History
Understanding Java HotSpot VM and Its Compilation Strategies
The Evolution of the HotSpot Execution Engine
Interpreter and JIT Compilation
Print Compilation
Tiered Compilation
Client and Server Compilers
Segmented Code Cache
Adaptive Optimization and Deoptimization
HotSpot Garbage Collector: Memory Management Unit
Generational Garbage Collection, Stop-the-World, and Concurrent Algorithms
Young Collections and Weak Generational Hypothesis
Old-Generation Collection and Reclamation Triggers
Parallel GC Threads, Concurrent GC Threads, and Their Configuration
The Evolution of the Java Programming Language and Its Ecosystem: A Closer Look
Java 1.1 to Java 1.4.2 (J2SE 1.4.2)
Java 5 (J2SE 5.0)
Java 6 (Java SE 6)
Java 7 (Java SE 7)
Java 8 (Java SE 8)
Java 9 (Java SE 9) to Java 16 (Java SE 16)
Java 17 (Java SE 17)
Embracing Evolution for Enhanced Performance
2 Performance Implications of Java’s Type System Evolution
Java’s Primitive Types and Literals Prior to J2SE 5.0
Java’s Reference Types Prior to J2SE 5.0
Java Interface Types
Java Class Types
Java Array Types
Java’s Type System Evolution from J2SE 5.0 until Java SE 8
Enumerations
Annotations
Other Noteworthy Enhancements (Java SE 8)
Java’s Type System Evolution: Java 9 and Java 10
Variable Handle Typed Reference
Java’s Type System Evolution: Java 11 to Java 17
Switch Expressions
Sealed Classes
Records
Beyond Java 17: Project Valhalla
Performance Implications of the Current Type System
The Emergence of Value Classes: Implications for Memory Management
Redefining Generics with Primitive Support
Exploring the Current State of Project Valhalla
Early Access Release: Advancing Project Valhalla’s Concepts
Use Case Scenarios: Bringing Theory to Practice
A Comparative Glance at Other Languages
Conclusion
3 From Monolithic to Modular Java: A Retrospective and Ongoing Evolution
Introduction
Understanding the Java Platform Module System
Demystifying Modules
Modules Example
Compilation and Run Details
Introducing a New Module
From Monolithic to Modular: The Evolution of the JDK
Continuing the Evolution: Modular JDK in JDK 11 and Beyond
Implementing Modular Services with JDK 17
Service Provider
Service Consumer
A Working Example
Implementation Details
JAR Hell Versioning Problem and Jigsaw Layers
Working Example: JAR Hell
Implementation Details
Open Services Gateway Initiative
OSGi Overview
Similarities
Differences
Introduction to Jdeps, Jlink, Jdeprscan, and Jmod
Jdeps
Jdeprscan
Jmod
Jlink
Conclusion
Performance Implications
Tools and Future Developments
Embracing the Modular Programming Paradigm
4 The Unified Java Virtual Machine Logging Interface
The Need for Unified Logging
Unification and Infrastructure
Performance Metrics
Tags in the Unified Logging System
Log Tags
Specific Tags
Identifying Missing Information
Diving into Levels, Outputs, and Decorators
Levels
Decorators
Outputs
Practical Examples of Using the Unified Logging System
Benchmarking and Performance Testing
Tools and Techniques
Optimizing and Managing the Unified Logging System
Asynchronous Logging and the Unified Logging System
Benefits of Asynchronous Logging
Implementing Asynchronous Logging in Java
Best Practices and Considerations
Understanding the Enhancements in JDK 11 and JDK 17
JDK 11
JDK 17
Conclusion
5 End-to-End Java Performance Optimization: Engineering Techniques and Micro-benchmarking with JMH
Introduction
Performance Engineering: A Central Pillar of Software Engineering
Decoding the Layers of Software Engineering
Performance: A Key Quality Attribute
Understanding and Evaluating Performance
Defining Quality of Service
Success Criteria for Performance Requirements
Metrics for Measuring Java Performance
Footprint
Responsiveness
Throughput
Availability
Digging Deeper into Response Time and Availability
The Mechanics of Response Time with an Application Timeline
The Role of Hardware in Performance
Decoding Hardware–Software Dynamics
Performance Symphony: Languages, Processors, and Memory Models
Enhancing Performance: Optimizing the Harmony
Memory Models: Deciphering Thread Dynamics and Performance Impacts
Concurrent Hardware: Navigating the Labyrinth
Order Mechanisms in Concurrent Computing: Barriers, Fences, and Volatiles
Atomicity in Depth: Java Memory Model and Happens-Before Relationship
Concurrent Memory Access and Coherency in Multiprocessor Systems
NUMA Deep Dive: My Experiences at AMD, Sun Microsystems, and Arm
Bridging Theory and Practice: Concurrency, Libraries, and Advanced Tooling
Performance Engineering Methodology: A Dynamic and Detailed Approach
Experimental Design
Bottom-Up Methodology
Top-Down Methodology
Building a Statement of Work
The Performance Engineering Process: A Top-Down Approach
Building on the Statement of Work: Subsystems Under Investigation
Key Takeaways
The Importance of Performance Benchmarking
Key Performance Metrics
The Performance Benchmark Regime: From Planning to Analysis
Benchmarking JVM Memory Management: A Comprehensive Guide
Why Do We Need a Benchmarking Harness?
The Role of the Java Micro-Benchmark Suite in Performance Optimization
Getting Started with Maven
Writing, Building, and Running Your First Micro-benchmark in JMH
Benchmark Phases: Warm-Up and Measurement
Loop Optimizations and @OperationsPerInvocation
Benchmarking Modes in JMH
Understanding the Profilers in JMH
Key Annotations in JMH
JVM Benchmarking with JMH
Profiling JMH Benchmarks with perfasm
Conclusion
6 Advanced Memory Management and Garbage Collection in OpenJDK
Introduction
Overview of Garbage Collection in Java
Thread-Local Allocation Buffers and Promotion-Local Allocation Buffers
Optimizing Memory Access with NUMA-Aware Garbage Collection
Exploring Garbage Collection Improvements
G1 Garbage Collector: A Deep Dive into Advanced Heap Management
Advantages of the Regionalized Heap
Optimizing G1 Parameters for Peak Performance
Z Garbage Collector: A Scalable, Low-Latency GC for Multi-terabyte Heaps
Future Trends in Garbage Collection
Practical Tips for Evaluating GC Performance
Evaluating GC Performance in Various Workloads
Types of Transactional Workloads
Synthesis
Live Data Set Pressure
Understanding Data Lifespan Patterns
Impact on Different GC Algorithms
Optimizing Memory Management
7 Runtime Performance Optimizations: A Focus on Strings, Locks, and Beyond
Introduction
String Optimizations
Literal and Interned String Optimization in HotSpot VM
String Deduplication Optimization and G1 GC
Reducing Strings’ Footprint
Enhanced Multithreading Performance: Java Thread Synchronization
The Role of Monitor Locks
Lock Types in OpenJDK HotSpot VM
Code Example and Analysis
Advancements in Java’s Locking Mechanisms
Optimizing Contention: Enhancements since Java 9
Visualizing Contended Lock Optimization: A Performance Engineering Exercise
Synthesizing Contended Lock Optimization: A Reflection
Spin-Wait Hints: An Indirect Locking Improvement
Transitioning from the Thread-per-Task Model to More Scalable Models
Traditional One-to-One Thread Mapping
Increasing Scalability with the Thread-per-Request Model
Reimagining Concurrency with Virtual Threads
Conclusion
8 Accelerating Time to Steady State with OpenJDK HotSpot VM
Introduction
JVM Start-up and Warm-up Optimization Techniques
Decoding Time to Steady State in Java Applications
Ready, Set, Start up!
Phases of JVM Start-up
Reaching the Application’s Steady State
An Application’s Life Cycle
Managing State at Start-up and Ramp-up
State During Start-up
Transition to Ramp-up and Steady State
Benefits of Efficient State Management
Class Data Sharing
Ahead-of-Time Compilation
GraalVM: Revolutionizing Java’s Time to Steady State
Emerging Technologies: CRIU and Project CRaC for Checkpoint/Restore Functionality
Start-up and Ramp-up Optimization in Serverless and Other Environments
Serverless Computing and JVM Optimization
Containerized Environments: Ensuring Swift Start-ups and Efficient Scaling
GraalVM’s Present-Day Contributions
Key Takeaways
Boosting Warm-up Performance with OpenJDK HotSpot VM
Compiler Enhancements
Segmented Code Cache and Project Leyden Enhancements
The Evolution from PermGen to Metaspace: A Leap Forward Toward Peak Performance
Conclusion
9 Harnessing Exotic Hardware: The Future of JVM Performance Engineering
Introduction to Exotic Hardware and the JVM
Exotic Hardware in the Cloud
Hardware Heterogeneity
API Compatibility and Hypervisor Constraints
Performance Trade-offs
Resource Contention
Cloud-Specific Limitations
The Role of Language Design and Toolchains
Case Studies
LWJGL: A Baseline Example
Aparapi: Bridging Java and OpenCL
Project Sumatra: A Significant Effort
TornadoVM: A Specialized JVM for Hardware Accelerators
Project Panama: A New Horizon
Envisioning the Future of JVM and Project Panama
High-Level JVM-Language APIs and Native Libraries
Vector API and Vectorized Data Processing Systems
Accelerator Descriptors for Data Access, Caching, and Formatting
The Future Is Already Knocking at the Door!
Concluding Thoughts: The Future of JVM Performance Engineering
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
X
Y
Z

✦ Subjects


Java Programming Language; Computer Programming; Java Performance Engineering


📜 SIMILAR VOLUMES


JVM Performance Engineering: Inside Open
✍ Monica Beckwith 📂 Library 📅 2024 🏛 Pearson 🌐 English

Dive into the depths of JVM performance engineering with Java Champion Monica Beckwith. JVM Performance Engineering is an essential guide for every seasoned Java developer. Demystifying the complexities of the Java Virtual Machine (JVM) performance, focusing on the OpenJDK HotSpot VM, Beckwith co

Inside the Java virtual machine
✍ Bill Venners 📂 Library 📅 1997 🏛 McGraw-Hill Companies 🌐 English

or the advanced Java developer, Inside the Java 2 Virtual Machine offers a detailed guide to the inner workings of today's Java Virtual Machines (JVMs), plus a complete reference to all bytecodes (the "machine code" for the language). For those who want to understand how Java really works, this book

Java Virtual Machine (JVM)
✍ Гузар В.В. 📂 Library 🌐 Russian

Реферат з курсу "Операційні системи компютерних мереж"<div class="bb-sep"></div><strong>Зміст</strong><br/>Вступ<br/><strong>Історія</strong><br/>Конкуренція між Sun і Microsoft<br/>Конкуренція між Sun і IBM<br/><strong>Формат файлів класу й типів даних</strong><br/>Типи даних<br/>Прості типи й знач

Mastering the Java Virtual Machine: An i
✍ Otàvio Santana 📂 Library 📅 2024 🏛 Packt Publishing Pvt. Ltd. 🌐 English

Mastering the Java Virtual Machine is a comprehensive guide that will take you into the heart of Java programming, guiding you through the intricate workings of the Java Virtual Machine (JVM) and equipping you with essential skills to become a proficient Java developer. You’ll start by understa