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 understanding the JVM, exploring its architecture and how it executes Java code. Through detailed explanations and real-world examples, you’ll gain a deep understanding of JVM internals, enabling you to write efficient and optimized Java applications.
As you progress, you’ll delve into memory management and execution, unraveling the complexities of heap and stack management, garbage collection, and memory profiling. You'll learn how memory is allocated and reclaimed in the JVM, as well as how to optimize memory usage and identify performance bottlenecks in your applications. With this knowledge, you’ll be able to create Java programs that are not only robust but also highly performant.
By the end of this book, you’ll have the skills needed to excel in Java programming, writing efficient, maintainable co
Author(s): Otàvio Santana
Publisher: Packt Publishing Pvt. Ltd.
Year: 2024
Language: English
Pages: 234
Mastering the Java Virtual Machine
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
Part 1: Understanding the JVM
1
Introduction to the Java Virtual Machine
Technical requirements
Exploring the evolution of Java
An overview of the JVM
How the JVM executes Java code
Summary
Questions
Answers
2
Class File Structure
Technical requirements
Decoding class files
Understanding the headers of class file
Fields and data repositories
Methods in the class file
Summary
Questions
Answers
3
Understanding Bytecodes
Technical requirements
Bytecode unveiled
Arithmetic operations
Addition, subtraction, multiplication, and division
Remainder and negation
Shift and bitwise operations
Local variable increment
Comparison operations
Value conversions
Object manipulation
Method calls and returns
Conditional instructions
Show me the bytecode
Summary
Questions
Answers
Part 2: Memory Management and Execution
4
Execution Engine
The foundation of execution
System operation layers
Decoding JVM execution
JIT compilation
Class loading
Summary
Questions
Answers
5
Memory Management
Technical requirements
Memory management in the JVM
Program counter
Java stack
Local variables
Operand stacks
Java stack at the bytecode
Native method stacks
Method area
Heap
Code Cache and JIT
Summary
Questions
Answers
6
Garbage Collection and Memory Profiling
GC overview
Serial GC
Parallel GC
G1
ZGC
JVM tuning and ergonomics
Summary
Questions
Answers
Part 3: Alternative JVMs
7
GraalVM
Technical requirements
GraalVM overview
Native Image
Creating a Native Image
Summary
Questions
Answers
8
The JVM Ecosystem and Alternative JVMs
The diversity of the JVM
Eclipse J9
Amazon Corretto
Azul Zulu and Zing
IBM Semeru
Eclipse Temurin
Even more JVM vendors and SDKMan
Summary
Questions
Answers
Part 4: Advanced Java Topics
9
Java Framework Principles
Why do we have frameworks?
Java metadata
Trade-offs in framework adoption
Java framework principles
Summary
Questions
Answers
10
Reflection
Technical requirements
Overview of reflection
Exploring practical reflection
Proxy
Summary
Questions
Answers
11
Java Annotation Processor
Technical requirements
Overview of Java Annotation Processor
Exploring Practical Java Annotation Processor
Summary
Questions
Answers
12
Final Considerations
Exploring the JVM landscape
Navigating the system operation architecture
Mastering the art of garbage collection
Platform threads and virtual threads
Summary
Index
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Share Your Thoughts
Download a free PDF copy of this book