Part 2. Under the hood

This part of the book is all about exploring how the JVM actually works. You’ll start off examining class loading. Many Java developers don’t have a good understanding of how the JVM actually loads, links, and verifies classes. This leads to frustration and wasted time when an “incorrect” version of some class is executed due to some sort of classloader conflict.

Being able to dive into the internals of a Java class file and the bytecode it contains is a powerful debugging skill. You’ll see how to use javap to navigate and understand the meaning of bytecode.

Next, you’ll come to grips with the multicore CPU revolution occurring in hardware. The well-grounded Java developer needs to be aware of Java’s concurrency capabilities. Chapters 5 and 6 will teach you how to get the most out of modern processors. First you’ll look at concurrency theory and the building blocks Java has had for concurrent programming since 2006 (Java 5). You’ll learn about the Java Memory Model and how threading and concurrency is implemented in that model.

Once you have some theory under your belt, we’ll guide you through the features of the java.util.concurrent package, which provides modern structures for practical development of concurrent Java.

Performance tuning is often seen as an art, as opposed to a science, and tracking down and fixing performance issues often takes development teams extraordinary time and effort. In chapter 7, the final chapter in this part, we’ll teach you to measure, not guess, and that “tuning by folklore” is wrong. You’ll learn a scientific approach that quickly gets you to the heart of your performance issues.

In particular, we focus on garbage collection (GC) and the just-in-time (JIT) compiler, two major parts of the JVM that affect performance. Among other performance knowledge, you’ll learn how to read GC logs and use the free Java VisualVM (jvisualvm) tool to analyze memory usage.

By the end of part 2, you’ll no longer be a developer who thinks only of the source code sitting in your IDE. You’ll know how Java and the JVM work under the hood, and you’ll be able to take full advantage of what is arguably the most powerful general-purpose VM the planet has to offer.

  

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.195.128