Chapter 6. The Java Virtual Machine

We all know that the best things in life are free. In a similar way, the best things in a language or computing environment are the things that we don’t have to think about at all. These are the things that are intellectually free. By not having to think about them, we free ourselves to think about other things. The task of programming—especially the task of programming large, long-lived systems of programs—is hard enough that anything we can use and not think about is a good thing.

In Java, it is the virtual machine that gives us a huge amount of functionality without requiring that we give back much, if any, thought. Most of the time, the virtual machine is to the Java programmer what water is to a fish. It is the environment in which we live, through which we move, and from which we draw our basic sustenance. But we rarely think about it, and when we do, it is generally because something about it has gotten in our way, is doing something unexpected, or we have to figure out how to configure the thing to run faster or better.

Since we as Java programmers think about the virtual machine only when it needs care and feeding (or when it is getting in our way), we often forget what it is doing for us. But the virtual machine changes the way we have to think about building large systems and has made that job much easier. So it is fitting that we spend a few pages to step back and think a bit about the Java virtual machine (hereafter simply the JVM), ...

Get Java: The Good Parts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.