Book Image

Oracle JRockit: The Definitive Guide

Book Image

Oracle JRockit: The Definitive Guide

Overview of this book

Oracle JRockit is one of the industry’s highest performing Java Virtual Machines. Java developers are always on the lookout for better ways to analyze application behavior and gain performance. As we all know, this is not as easy as it looks. Welcome to JRockit: The Definitive Guide.This book helps you gain in-depth knowledge of Java from the JVM’s point of view. We will explain how to write code that works well with the JVM to gain performance and scalability. Starting with the inner workings of the JRockit JVM and finishing with a thorough walkthrough of the tools in the JRockit Mission Control suite, this book is for anyone who wants to know more about how the JVM executes your Java application and how to profile for better performance.
Table of Contents (23 chapters)
Oracle JRockit
Credits
Foreword
About the Authors
Acknowledgement
About the Reviewers
Preface
12
Using the JRockit Management APIs
Bibliography
Glossary
AST
CAS
HIR
IR
JFR
JMX
JRA
JSR
LIR
MD5
MIR
PDE
RCP
SWT
TLA
Index

Prefetching


Prefetching is the act of retrieving memory into cache lines ahead of time, before the memory is to be accessed. While a prefetch is a slow operation, this doesn't necessarily matter if enough time (unrelated instructions to be executed) exists between the prefetch and the memory access in question. Then, the latency caused by the prefetch will be hidden, and the memory access will be orders of magnitude faster, since the memory is guaranteed to be in the cache upon access.

Prefetching can be done implicitly by the CPU (hardware prefetching) or explicitly by the programmer, by placing prefetch instructions in the code (software prefetching).

Software prefetching is often done heuristically by the compiler. In JRockit it is used, for example, to access TLA space for object allocation and in optimized code before large amounts of field accesses take place. Placing prefetch instructions in the wrong locations can be detrimental to performance.

See also Thread local area, Hardware prefetching, and Software prefetching.