Read, debug, and optimize JVM applications
Laurentiu Spilca

#Java
#JVM
Effectively reading and understanding existing code is a developer’s superpower. In this book, you’ll master techniques for code profiling, advanced debugging, and log evaluation to find and fix bugs and performance problems.
Troubleshooting Java: Read, debug, and optimize JVM applications teaches you how to better understand Java application code. It’s filled with code investigation techniques for tricky issues like uncovering glitches in code logic or locating intermittent runtime problems.
Armed with the tools and practices in this invaluable guide, you’ll save time whenever you need to identify performance issues, understand dependencies, discover the root cause of crashes, or interpret unexpected results. Whether you’re a senior software engineer or you’re just getting started, Troubleshooting Java: Read, debug, and optimize JVM applications will help you in the fundamental task of understanding how your applications work.
What's inside
About the technology
Fact: Over the course of your career, you’ll spend far more time reading code than you will writing it. The code investigation skills in this book will radically improve your efficiency in understanding and improving Java applications.
About the book
Troubleshooting Java: Read, debug, and optimize JVM applications presents practical techniques for exploring and repairing unfamiliar code. In it, you’ll learn timesaving practices for discovering hidden dependencies, discovering the root causes of crashes, and interpreting unexpected results. Go beyond profiling and debugging and start understanding how Java applications really work.
Review
"We spend more time trying to understand code than writing it. This book shows you how to use that time wisely." —Brent Honadel, Infor
"Finally a book that illustrates how to troubleshoot and reason about Java apps in production! It just might save the day!" —Atul Shriniwas Khot, SquareOne Insights
"I wish I had this collection of efficient and usable techniques at the beginning of my career." —Andriy Stosyk, EPAM Systems
"A great book with deep explanations about debugging techniques." —Cătălin Matei, Endava
"Understand how Java applications work under the hood." —Fernando Bernardino, Wise
Searching for bugs, detangling messy legacy code, or evaluating your codebase for new features sucks up much of a developer's time. Effectively reading and understanding existing code is a true superpower! Troubleshooting Java, Second Edition teaches you to efficiently analyze and debug Java applications using time-tested tools and new AI-powered techniques.
In Troubleshooting Java, Second Edition you’ll learn:
• Efficiently use debuggers to quickly understand complex code
• Utilize AI-driven tools to automate log analysis, trace execution, and predict problems
• Correctly implement and interpret application logs
• Identify performance bottlenecks and optimize slow execution paths
• Profile SQL queries to diagnose and optimize database interactions
• Evaluate heap dumps to detect and fix memory leaks
• Analyze thread dumps to resolve deadlocks and concurrency issues
• Navigate the intricacies of service-oriented and microservices systems
In Troubleshooting Java, Second Edition Java veteran Laurentiu Spilca shares techniques for reading, profiling, debugging, and optimizing Java code that he’s honed over years working with high-stakes systems. This fully-revised second edition, updates coverage for new Java tools and adds methods for saving time and effort using AI. You’ll master techniques to identify memory leaks, optimize database queries, and resolve threading issues with ease. The code samples are in Java, but the skills you learn in this guide can be applied to any JVM language.
About the Technology
Whether you’re working with legacy systems or using AI to generate fresh programs, you’ll spend more time reading and fixing code than writing it from scratch. Troubleshooting is a messy art, and efficient profiling, logging, debugging, and optimization will save you hours of time and countless headaches.
About the Book
Troubleshooting Java, Second Edition teaches practical techniques to diagnose, debug, and optimize Java applications. You’ll learn to uncover hidden dependencies, diagnose crashes, and resolve performance issues using tools like IntelliJ IDEA Debugger, VisualVM, and Heap Dump Analyzer. This revised and updated second edition introduces AI-powered troubleshooting tools, along with techniques for modern Java and cloud-native apps.
What's inside
• Use debuggers to quickly understand complex code
• Automate code analysis with AI tools
• Implement and interpret application logs
• Identify performance bottlenecks
About the Reader
For intermediate Java developers.
Table of Contents
Part 1 Revisiting the foundation for code investigation
1 Starting to know your apps
2 Understanding your app’s logic through debugging techniques
3 Finding problem root causes using advanced debugging techniques
4 Making the most of logs: Auditing an app’s behavior
Part 2 Deep diagnosing an app’s execution
5 Identifying resource consumption problems using profiling techniques
6 Finding hidden problems using profiling techniques
7 Investigating locks in multithreaded architectures
8 Investigating deadlocks with thread dumps
Part 3 Diagnosing memory-related problems
9 Profiling memory-related problems
10 Investigating memory problems with heap dumps
11 Analyzing potential JVM problems with GC logs
Part 4 Finding problems in large systems
12 Uncovering system-level failures and service communication problems
13 Measuring data consistency and transactions
A Tools you’ll need
B Opening a project
C Recommended further reading
D Understanding Java threads
E Memory management in Java apps
About the Author
Laurentiu Spilca is a skilled Java and Spring developer and an experienced technology instructor. He is the author of Spring Start Here and Spring Security in Action.









