liveBook · Manning

What you will learn in Troubleshooting Java: Read, debug, and optimize JVM applications

Read, debug, and optimize JVM applications

by Laurentiu Spilca

Chapter by chapter

Chapter 1: Revealing an app’s obscurities

This introduction explains why efficient code investigation matters and clarifies how developers use the term debugging.

1.1 How to more easily understand your app · 1.2 Typical scenarios for using investigation techniques · 1.2.1 Demystifying the unexpected output · 1.2.2 Learning certain technologies · 1.2.3 Clarifying slowness · 1.2.4 Understanding app crashes · 1.3 What you will learn in this book · 1.4 Summary

What you learn in chapter 1 →

Chapter 2: Understanding your app’s logic through debugging techniques

This introduction defines a debugger and explains its role in understanding complex code.

2.1 When analyzing code is not enough · 2.2 Investigating code with a debugger · 2.2.1 What is the execution stack trace, and how do I use it? · 2.2.2 Navigating code with the debugger · 2.3 When using the debugger might not be enough · 2.4 Summary

What you learn in chapter 2 →

Chapter 3: Finding problem root causes using advanced debugging techniques

This introduction previews advanced debugger approaches for investigating code more efficiently.

3.1 Minimizing investigation time with conditional breakpoints · 3.2 Using breakpoints that don’t pause the execution · 3.3 Dynamically altering the investigation scenario · 3.4 Rewinding the investigation case · 3.5 Summary

What you learn in chapter 3 →

Chapter 4: Debugging apps remotely

The introduction explains why environment-specific problems may require remote debugging, using entropy-related slowness as an example.

4.1 What is remote debugging? · 4.2 Investigating in remote environments · 4.2.1 The scenario · 4.2.2 Finding issues in remote environments · 4.3 Summary

What you learn in chapter 4 →

Chapter 5: Making the most of logs: Auditing an app’s behavior

This introduction explains how logs help investigate application behavior, what a useful log message contains, and why logs are a good starting point for investigations.

5.1 Investigating issues with logs · 5.1.1 Using logs to identify exceptions · 5.1.2 Using exception stack traces to identify what calls a method · 5.1.3 Measuring time spent to execute a given instruction · 5.1.4 Investigating issues in multithreaded architectures · 5.2 Implementing logging · 5.2.1 Persisting logs · 5.2.2 Defining logging levels and using logging frameworks · 5.2.3 Problems caused by logging and how to avoid them · 5.3 Logs vs. remote debugging · 5.4 Summary

What you learn in chapter 5 →

Chapter 6: Identifying resource consumption problems using profiling techniques

This introduction describes how a profiler can help investigate difficult JVM application problems by revealing resource use, thread status, and executing code.

6.1 Where would a profiler be useful? · 6.1.1 Identifying abnormal usage of resources · 6.1.2 Finding out what code executes · 6.1.3 Identifying slowness in an app’s execution · 6.2 Using a profiler · 6.2.1 Installing and configuring VisualVM · 6.2.2 Observing the CPU and memory usage · 6.2.3 Identifying memory leaks · 6.3 Summary

What you learn in chapter 6 →

Chapter 7: Finding hidden issues using profiling techniques

Introduces profiling as a way to investigate execution in hard-to-read applications and previews the chapter’s techniques.

7.1 Sampling to observe executing code · 7.2 Profiling to learn how many times a method executed · 7.3 Using a profiler to identify SQL queries an app executes · 7.3.1 Using a profiler to retrieve SQL queries not generated by a framework · 7.3.2 Using the profiler to get the SQL queries generated by a framework · 7.3.3 Using the profiler to get programmatically generated SQL queries · 7.4 Summary

What you learn in chapter 7 →

Chapter 8: Using advanced visualization tools for profiled data

This introduction describes call graphs and flame graphs as investigation views and explains why the chapter uses JProfiler alongside prior VisualVM techniques.

8.1 Detecting problems with JDBC connections · 8.2 Understanding the app’s code design using call graphs · 8.3 Using flame graphs to spot performance problems · 8.4 Analyzing queries on NoSQL databases · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Investigating locks in multithreaded architectures

This introduction previews techniques for investigating execution and performance in multithreaded applications and identifies prerequisite threading knowledge.

9.1 Monitoring threads for locks · 9.2 Analyzing thread locks · 9.3 Analyzing waiting threads · 9.4 Summary

What you learn in chapter 9 →

Chapter 10: Investigating deadlocks with thread dumps

This introduction explains deadlocks and why thread dumps help investigate an unresponsive JVM process.

10.1 Getting a thread dump · 10.1.1 Getting a thread dump using a profiler · 10.1.2 Generating a thread dump from the command line · 10.2 Reading thread dumps · 10.2.1 Reading plain-text thread dumps · 10.2.2 Using tools to better grasp thread dumps · 10.3 Summary

What you learn in chapter 10 →

Chapter 11: Finding memory-related issues in an app’s execution

This introduction explains the consequences of poor memory management and why heap dumps can help investigate crashes.

11.1 Sampling and profiling for memory issues · 11.2 Using heap dumps to find memory leaks · 11.2.1 Obtaining a heap dump · 11.2.2 Reading a heap dump · 11.2.3 Using the OQL console to query a heap dump · 11.3 Summary

What you learn in chapter 11 →

Chapter 12: Investigating apps’ behaviors in large systems

This introduction explains why investigating large systems requires looking beyond the behavior of individual applications.

12.1 Investigating communication between services · 12.1.1 Using HTTP server probes to observe HTTP requests · 12.1.2 Using HTTP client probes to observe HTTP requests the app sends · 12.1.3 Investigating low-level events on sockets · 12.2 The relevance of integrated log monitoring · 12.3 Using deployment tools in investigations · 12.3.1 Using fault injection to mimic hard-to-replicate issues · 12.3.2 Using mirroring to facilitate testing and error detection · 12.4 Summary

What you learn in chapter 12 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.