وبلاگ بلیان

JVM Performance Engineering: Inside OpenJDK and the HotSpot Java Virtual Machine (Developer's Library)

معرفی کتاب «JVM Performance Engineering: Inside OpenJDK and the HotSpot Java Virtual Machine (Developer's Library)» نوشتهٔ Monica Beckwith، منتشرشده توسط نشر Addison-Wesley Professional در سال 2024. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «JVM Performance Engineering: Inside OpenJDK and the HotSpot Java Virtual Machine (Developer's Library)» در دستهٔ برنامه‌نویسی قرار دارد.

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. 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 JVM Performance Engineering: Inside the OpenJDK Hotspot VM teaches experienced programmers how to tap Java's extensive API, automatic memory management and tools such as the micro benchmarking harness, and to develop their applications while being platform agnostic. Featuring sample code that reflects real-world use cases, this practical book by JavaOne Rockstar Monica Beckwith explains the key features and functions of the JVM. JVM Performance Engineering covers managed runtimes concepts such as just-in-time compilation (JIT), ahead-of-time compilation (AOT), and memory management. It examines these concepts from a performance perspective and classifies their impact on throughput, startup, footprint and responsiveness and benchmarking considerations. For more seasoned Java programmers, this book provides a detailed understanding of the newer concepts introduced since Java SE9, focusing on their possible performance considerations. Beckwith shows how Java's new module system (Project Jigsaw) enables working developers to build scalable solutions that are more secure and maintainable; and deliver exceptional performance. She reviews Java SE 9 changes in areas ranging from data types to performance optimizations; showing how to make the most of Java's new tools and facilities. You will learn about OpenJDK's Java 11 LTS (Long Term Support) update and enhancements coming in OpenJDK Java 15 such as its newer garbage collectors, its logging framework, and micro-benchmarking harness (aka JMH). You'll learn how to: Create microbenchmarks using the microbenchmarking harness Create a modular jar Take advantage of Java's new logging interface Take full advantage of the new default GC (garbage collection) Use sjavac, segmented code caches, and contended object monitors Create, compile and profile simple applications using the Netbeans IDE, and Oracle Developer Studio Performance Analyzer and much more If you're serious about performance engineering--or want to know why you... This comprehensive guide to Java Virtual Machine (JVM) performance engineering is an indispensable resource for every experienced Java developer. World-renowned Java performance expert Monica Beckwith focuses specifically on the OpenJDK HotSpot VM, thoroughly demystifies complex aspects of JVM performance, shares powerful diagnosis techniques, and helps you implement effective optimizations throughout your own code. First, Beckwith reviews the evolution of Java and the JVM, illuminating garbage collection strategies, parallel and concurrent GC threads, and their performance implications. Next, she expertly discusses the Java type system's evolution, its impact on performance and efficiency, and potential Project Valhalla enhancements. Beckwith shows how to transform monolithic Java applications to the modern, modular Java paradigm, updating project structures, ensuring dependency compatibility, and managing modules to optimize performance. You'll learn how to make the most of the Unified Java Virtual Machine Logging Interface to maximize process visibility and control, and improve debugging and performance testing. With these foundations in place, Beckwith introduces techniques for end-to-end Java performance optimization, including micro-benchmarking to assess and enhance the performance of any Java code. Beckwith provides in-depth coverage of advanced memory management in OpenJDK, showing how to leverage recent JDK optimizations and algorithms, and make the most of Thread-Local Allocation Buffers (TLABs) and Non-Uniform Memory Architecture (NUMA). A full chapter on runtime performance optimization includes a preview of the future of concurrency with Project Loom. Beckwith concludes with advanced techniques for accelerating app startup with OpenJDK, including up-to-date coverage of Elastic Metaspace, Project Leyden, and GraalVM. Inside Java Se 9 Teaches Experienced Programmers Exactly How To Take Full Advantage Of Java Se 9's Major, Long-awaited Improvements. Java Champion Monica Beckwith Relies On Extensive Sample Code Reflecting Real-world Use Cases To Illustrate Java Se 9's Key Features And Functions, And Demonstrate The Benefits Of Utilising Them. Beckwith Shows How Java's New Module System (project Jigsaw) Enables Working Developers To Build Solutions That Scale Easily From Tiny Devices To Large And Complex Libraries; Are More Secure And Maintainab≤ And Deliver Exceptional Performance. She Reviews Java Se 9 Changes In Areas Ranging From Data Types And Packages To Classes And Interfaces, Showing How To Make The Most Of Java's New Tools And Facilities.
دانلود کتاب JVM Performance Engineering: Inside OpenJDK and the HotSpot Java Virtual Machine (Developer's Library)