Troubleshooting Java: Read, debug, and optimize JVM applications
- Length: 365 pages
- Edition: 1
- Language: English
- Publisher: Manning
- Publication Date: 2023-03-07
- ISBN-10: 1617299774
- ISBN-13: 9781617299773
- Sales Rank: #2151515 (See Top 100 Books)
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.
How To Read Java: Understanding, debugging, and optimizing 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, How To Read Java will help you in the fundamental task of understanding how your applications work.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
Troubleshooting Java contents preface acknowledgments about this book Who should read this book How this book is organized: A roadmap About the code liveBook discussion forum Author online about the author about the cover illustration Part 1: The basics of investigating a codebase Chapter 1: Revealing an app’s obscurities 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 Chapter 2: Understanding your app’s logic through debugging techniques 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 Chapter 3: Finding problem root causes using advanced debugging techniques 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 Chapter 4: Debugging apps remotely 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 Chapter 5: Making the most of logs: Auditing an app’s behavior 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 Part 2: Deep analysis of an app’s execution Chapter 6: Identifying resource consumption problems using profiling techniques 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 Chapter 7: Finding hidden issues using profiling 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 Chapter 8: Using advanced visualization tools for profiled data 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 Chapter 9: Investigating locks in multithreaded architectures 9.1 Monitoring threads for locks 9.2 Analyzing thread locks 9.3 Analyzing waiting threads Chapter 10: Investigating deadlocks with thread dumps 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 Chapter 11: Finding memory- related issues in an app’s execution 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 Part 3: Finding problems in large systems Chapter 12: Investigating apps’ behaviors in large systems 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 appendix A: Tools you’ll need appendix B: Opening a project appendix C: Recommended further reading appendix D: Understanding Java threads D.1 What is a thread? D.2 A thread’s life cycle D.3 Synchronizing threads D.3.1 Synchronized blocks D.3.2 Using wait(), notify(), and notifyAll() D.3.3 Joining threads D.3.4 Blocking threads for a defined time D.3.5 Synchronizing threads with blocking objects D.4 Common issues in multithreaded architectures D.4.1 Race conditions D.4.2 Deadlocks D.4.3 Livelocks D.4.4 Starvation D.5 Further reading appendix E: Memory management in Java apps E.1 How the JVM organizes an app’s memory E.2 The stack used by threads to store local data E.3 The heap the app uses to store object instances E.4 The metaspace memory location for storing data types index A B C D E F G H I J L M N O P Q R S T U V W X Z
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.