Jump to ratings and reviews
Rate this book

Java Performance

Rate this book
“The definitive master class in performance tuning Java applications…if you love all the gory details, this is the book for you.” –James Gosling, creator of the Java Programming Language

 

Improvements in the Java platform and new multicore/multiprocessor hardware have made it possible to dramatically improve the performance and scalability of Java software.



Java™ Performance covers the latest Oracle and third-party tools for monitoring and measuring performance on a wide variety of hardware architectures and operating systems. The authors present dozens of tips and tricks you’ll find nowhere else.



You’ll learn how to construct experiments that identify opportunities for optimization, interpret the results, and take effective action. You’ll also find powerful insights into microbenchmarking–including how to avoid common mistakes that can mislead you into writing poorly performing software. Then, building on this foundation, you’ll walk through optimizing the Java HotSpot VM, standard and multitiered applications; Web applications, and more. Coverage includes

Taking a proactive approach to meeting application performance and scalability goals Monitoring Java performance at the OS level in Windows, Linux, and Oracle Solaris environments Using modern Java Virtual Machine (JVM) and OS observability tools to profile running systems, with almost no performance penalty Gaining “under the hood” knowledge of the Java HotSpot VM that can help you address most Java performance issues Integrating JVM-level and application monitoring Mastering Java method and heap (memory) profiling Tuning the Java HotSpot VM for startup, memory footprint, response time, and latency Determining when Java applications require rework to meet performance goals Systematically profiling and tuning performance in both Java SE and Java EE applications Optimizing the performance of the Java HotSpot VM

Using this book, you can squeeze maximum performance and value from all your Java applications–no matter how complex they are, what platforms they’re running on, or how long you’ve been running them.

1522 pages, Kindle Edition

First published January 1, 2010

42 people are currently reading
560 people want to read

About the author

Charlie Hunt

10 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
85 (41%)
4 stars
75 (36%)
3 stars
39 (18%)
2 stars
4 (1%)
1 star
3 (1%)
Displaying 1 - 7 of 7 reviews
Profile Image for Eric.
108 reviews17 followers
February 1, 2012

I sat in an airport reading this for quite a while as some guy next to me sat talking on his phone helping people troubleshoot Linux servers. Clearly an extrovert, he kept talking to random people even between his phone calls. When he finally finished, he asked me about the “novel” I was reading. I laughed at how he called it a novel – the plot was thin and characterization left a lot to be desired - but in the end he laughed harder: in some circles, the two words “Java” and “Performance” are considered contradictions.

This is not a book about code, algorithms, or even programming. It’s about tuning. It’s about using freely available tools to diagnose problems like lock contention, memory swapping, or disk usage. It’s about understanding how your CPU architecture impacts the performance of your application. It’s about understanding what goes on in the background in the Java virtual machine, like garbage collection, just-in-time compilation, decompilation and re-optimization, and other stuff that you might not know is going on. It’s about how to monitor or ultimately profile your application to diagnose problems. It’s about how to optimize the memory/latency/throughput tradeoffs. It’s about how to set up benchmarks to accurately measure differences in performance. It’s about how to get the best throughput in a service oriented architecture.

In other words, this is a lot more useful than a bag of coding tricks to make your program work better. A knowledge and understanding of the workings of the JVM can be useful (and hopefully interesting) to anyone who works on moderate to complex Java applications. While I would recommend the first few chapters to any developer, this is most useful for those who need to squeeze the most out of their systems with strict memory or latency requirements, or a need to maximize the responsiveness of their system.
Profile Image for Emre Sevinç.
175 reviews430 followers
April 19, 2017
Drinking from the Firehose
=====================

Even though the Java platform (along with JVM) is one of the most ubiquitous software development platforms, it was surprisingly difficult to find a self-contained book dedicated to performance aspects of Java platform. “Java Performance” by Charlie Hunt and Binu John can be considered the only solid and contemporary reference in the domain of performance analysis and tuning of Java based systems. No matter which programming language you use to run on JVM, this book is the essential reference until something better comes along.

On the other hand, make no mistake, this is not a lightweight book, or a cookbook which you can consult for a few performance tuning recipes. Reading Java Performance is more like drinking from the firehose. Whether you are a beginner, or a seasoned developer, it will take time to digest the gory details presented. Luckily, the book’s logical organization is close to perfect and some of the chapters are pretty self-contained.

From start to finish, it is not difficult to see that if you want to consider yourself a serious Java performance engineer, you need to master the majority of the book. Chapter 2 starts with an overview of the basics of operating systems performance and monitoring, setting the stage for the upcoming chapters and acting as a refresher. The authors are very careful to explain concepts concretely by giving examples from Linux, Solaris and MS Windows systems, which makes sense given the portability of JVM. Chapter 3 and 4, if taken together, provide the most comprehensive technical explanation of Java Virtual Machine and Just-in Time compilation from a performance perspective. Even if you are not facing performance problems (yet), this two chapters make a very solid and clear reference for understanding JVM and JIT technology. The terminology, concepts and details in these chapters are very important: Without a solid understanding of them, it is not easy to understand the discussions in the following chapters.

Chapters 5 and 6 focus on profiling, which makes sense, because you cannot improve something if you can’t measure it carefully. After introducing the fundamental concepts about profiling, the authors give concrete examples using different profilers, such as Oracle Solaris Studio Performance Anaylzer, and NetBeans profiler.

Chapter 7 can be considered the most critical part of the book. Authors dedicate 70 pages to a detailed discussion on tuning the JVM and the various garbage collectors. They refrain from making bold statements and always stress how these things are very context sensitive and without proper measurement and profiling not many things can be generalized. They have my utmost respect for this scientific and engineering approach.

Chapter 8, “Benchmarking Java Applications” is where the scientific approach is taken to its full potential: The authors explain how to construct hypotheses regarding performance problems, how to conduct experiments to gather data from the system in question, and then how to use statistical methods to interpret the results. If you have a scientific background, especially natural sciences, where you had to use statistical methods to analyze experiment data, then this chapter will be very familiar (but I guess this is also where the brains of the majority of the Java developers will explode).

The remaining chapters continue with the theme of benchmarking, each chapter dedicate to even more specialized domains of benchmarking. For example Chapter 9 focuses on the topic of benchmarking multi-tiered applications and it even dares to touch the topic of Markov chains for modeling realistic interactions and therefore gathering useful synthetic data (taking into account the fact that for most of the enterprise Java developers secondary school arithmetic is more than enough, this chapter can be easily considered as rocket science for the majority of Java developers).

The remaining chapters delve into the details of web application, web services and persistence performance, each one concentrating on the unique analysis, performance and tuning challenges of those domains.

There is not much to critcize in this superb technical book dedicated to the performance enginnering on the Java platform. A few minor criticisms: The authors’ reference to SPECjbb2013, a very detailed benchmark suite that is not freely available. If you want to try out some of the examples in the book, you have to buy that suite. You can alternatively try to come up with similar examples using the freely available SPECjvm2008, but it would be better if the authors used something that is freely available. Apart from that, authors are a little biased towards Oracle, e.g. mentioning only NetBeans and Solaris Studio Performance Anaylzer, without touching on Eclipse. Finally, even though they provide detailed code listings which are used to indicate different techniques for performance anaylsis and profiling, they are not from real world scenarios and this artificial examples might not be very helpful for the majority of the developers (apart from demonstration purposes).

Conclusion: I can wholeheartedly recommend this book to any software engineer who wants to understand the Java platform and Java Virtual Machine from a performance perspective, as well as to engineers who want to tune their applications for better performance.
Profile Image for Paul.
61 reviews7 followers
June 6, 2012
Solid overview of JVM tuning, performance monitoring, profiling and all of the low-level technical details of the JVM that are worth knowing when needing to debug performance issues. A solid book to have on hand as a reference.
4 reviews1 follower
August 26, 2012
Very useful for anyone working on large-scale Java applications.
Displaying 1 - 7 of 7 reviews

Can't find what you're looking for?

Get help and learn more about the design.