Oracle JRockit: The Definitive Guide

Oracle JRockit: The Definitive Guide
eBook: $41.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $111.98    Print cover: $69.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Learn about the fundamental building blocks of a JVM, such as code generation and memory management, and utilize this knowledge to develop code you can count on
  • Realize the full potential of Java applications by learning how to apply advanced tuning and analysis
  • Work with the JRockit Mission Control 3.1/4.0 tools suite to debug or profile your Java applications
  • Learn the simplicity and performance benefits of virtualizing Java through JRockit Virtual Edition
  • Written by Marcus Hirt and Marcus Lagergren, founder members of Appeal Virtual Machines, the company that created the Java Virtual Machine: JRockit

Book Details

Language : English
Paperback : 588 pages [ 235mm x 191mm ]
Release Date : June 2010
ISBN : 1847198066
ISBN 13 : 9781847198068
Author(s) : Marcus Hirt, Marcus Lagergren
Topics and Technologies : All Books, Enterprise Products and Platforms, Oracle Fusion Middleware, Enterprise, Java, Oracle, Virtualisation

Table of Contents

Chapter 1: Getting Started
Chapter 2: Adaptive Code Generation
Chapter 3: Adaptive Memory Management
Chapter 4: Threads and Synchronization
Chapter 5: Benchmarking and Tuning
Chapter 6: JRockit Mission Control
Chapter 7: The Management Console
Chapter 8: The Runtime Analyzer
Chapter 9: The Flight Recorder
Chapter 10: The Memory Leak Detector
Chapter 11: JRCMD
Chapter 12: Using the JRockit Management APIs
Chapter 13: JRockit Virtual Edition
Appendix A: Bibliography
Appendix B: Glossary
  • Chapter 1: Getting Started
    • Obtaining the JRockit JVM
    • Migrating to JRockit
      • Command-line options
        • System properties
        • Standardized options
        • Non-standard options
      • Changes in behavior
    • A note on JRockit versioning
    • Getting help
    • Summary
  • Chapter 2: Adaptive Code Generation
    • Platform independence
    • The Java Virtual Machine
      • Stack machine
      • Bytecode format
        • Operations and operands
        • The constant pool
    • Code generation strategies
      • Pure bytecode interpretation
      • Static compilation
      • Total JIT compilation
      • Mixed mode interpretation
    • Adaptive code generation
      • Determining "hotness"
        • Invocation counters
        • Software-based thread sampling
        • Hardware-based sampling
      • Optimizing a changing program
    • Inside the JIT compiler
      • Working with bytecode
        • Bytecode obfuscation
      • Bytecode "optimizers"
        • Abstract syntax trees
      • Where to optimize
    • The JRockit code pipeline
      • Why JRockit has no bytecode interpreter
      • Bootstrapping
      • Runtime code generation
        • Trampolines
        • Code generation requests
        • Optimization requests
        • On-stack replacement
        • Bookkeeping
      • A walkthrough of method generation in JRockit
        • The JRockit IR format
        • JIT compilation
        • Generating optimized code
    • Controlling code generation in JRockit
      • Command-line flags and directive files
        • Command-line flags
        • Directive files
    • Summary
  • Chapter 3: Adaptive Memory Management
    • The concept of automatic memory management
      • Adaptive memory management
      • Advantages of automatic memory management
      • Disadvantages of automatic memory management
    • Fundamental heap management
      • Allocating and releasing objects
      • Fragmentation and compaction
    • Garbage collection algorithms
      • Reference counting
      • Tracing techniques
        • Mark and sweep
        • Stop and copy
      • Stopping the world
        • Conservative versus exact collectors
        • Livemaps
      • Generational garbage collection
        • Multi generation nurseries
        • Write barriers
      • Throughput versus low latency
        • Optimizing for throughput
        • Optimizing for low latency
      • Garbage collection in JRockit
        • Old collections
        • Nursery collections
        • Permanent generations
        • Compaction
    • Speeding it up and making it scale
      • Thread local allocation
      • Larger heaps
        • 32-Bits and the 4-GB Barrier
        • The 64-bit world
      • Cache friendliness
        • Prefetching
        • Data placement
      • NUMA
      • Large pages
      • Adaptability
    • Near-real-time garbage collection
      • Hard and soft real-time
      • JRockit Real Time
        • Does the soft real-time approach work?
        • How does it work?
    • The Java memory API
      • Finalizers
      • References
        • Weak references
        • Soft references
        • Phantom references
      • Differences in JVM behavior
    • Pitfalls and false optimizations
      • Java is not C++
    • Controlling JRockit memory management
      • Basic switches
        • Outputting GC data
        • Set initial and maximum heap size
        • Controlling what to optimize for
        • Specifying a garbage collection strategy
      • Compressed references
      • Advanced switches
    • Summary
  • Chapter 4: Threads and Synchronization
    • Fundamental concepts
      • Hard to debug
      • Difficult to optimize
        • Latency analysis
    • Java API
      • The synchronized keyword
      • The java.lang.Thread class
      • The java.util.concurrent package
      • Semaphores
      • The volatile keyword
    • Implementing threads and synchronization in Java
      • The Java Memory Model
        • Early problems and ambiguities
        • JSR-133
      • Implementing synchronization
        • Primitives
        • Locks
      • The Java bytecode implementation
        • Lock pairing
      • Implementing threads
        • Green threads
        • OS threads
    • Optimizing threads and synchronization
      • Lock inflation and lock deflation
      • Recursive locking
      • Lock fusion
      • Lazy unlocking
        • Implementation
        • Object banning
        • Class banning
        • Results
    • Pitfalls and false optimizations
      • Thread.stop, Thread.resume and Thread.suspend
      • Double checked locking
    • JRockit flags
      • Examining locks and lazy unlocking
        • Lock details from -Xverbose:locks
        • Controlling lazy unlocking with –XX:UseLazyUnlocking
      • Using SIGQUIT or Ctrl-Break for Stack Traces
      • Lock profiling
        • Enabling lock profiling with -XX:UseLockProfiling
      • Setting thread stack size using -Xss
      • Controlling lock heuristics
    • Summary
  • Chapter 5: Benchmarking and Tuning
    • Reasons for benchmarking
      • Performance goals
      • Performance regression testing
      • Easier problem domains to optimize
      • Commercial success
    • What to think of when creating a benchmark
      • Measuring outside the system
      • Measuring several times
      • Micro benchmarks
        • Micro benchmarks and on-stack replacement
        • Micro benchmarks and startup time
      • Give the benchmark a chance to warm-up
    • Deciding what to measure
      • Throughput
      • Throughput with response time and latency
      • Scalability
      • Power consumption
      • Other issues
    • Industry-standard benchmarks
      • The SPEC benchmarks
        • The SPECjvm suite
        • The SPECjAppServer / SPECjEnterprise2010 suite
        • The SPECjbb suite
      • SipStone
      • The DaCapo benchmarks
      • Real world applications
    • The dangers of benchmarking
    • Tuning
      • Out of the box behavior
      • What to tune for
        • Tuning memory management
        • Tuning code generation
        • Tuning locks and threads
        • Generic tuning
    • Common bottlenecks and how to avoid them
      • The –XXaggressive flag
      • Too many finalizers
      • Too many reference objects
      • Object pooling
      • Bad algorithms and data structures
        • Classic textbook issues
        • Unwanted intrinsic properties
      • Misuse of System.gc
      • Too many threads
      • One contended lock is the global bottleneck
      • Unnecessary exceptions
      • Large objects
      • Native memory versus heap memory
    • Wait/notify and fat locks
      • Wrong heap size
      • Too much live data
      • Java is not a silver bullet
    • Summary
  • Chapter 6: JRockit Mission Control
    • Background
      • Sampling-based profiling versus exact profiling
      • A different animal to different people
    • Mission Control overview
      • Mission Control server-side components
      • Mission Control client-side components
      • Terminology
      • Running the standalone version of Mission Control
      • Running JRockit Mission Control inside Eclipse
      • Starting JRockit for remote management
        • The JRockit Discovery Protocol
      • Running in a secure environment
      • Troubleshooting connections
        • Hostname resolution issues
    • The Experimental Update Site
    • Debugging JRockit Mission Control
    • Summary
  • Chapter 7: The Management Console
    • A JMX Management Console
    • Using the console
      • General
        • The Overview
      • MBeans
        • MBean Browser
        • Triggers
      • Runtime
        • System
        • Memory
        • Threads
      • Advanced
        • Method Profiler
        • Exception Count
        • Diagnostic Commands
      • Other
        • JConsole
    • Extending the JRockit Mission Control Console
    • Summary
  • Chapter 8: The Runtime Analyzer
    • The need for feedback
      • Recording
    • Analyzing JRA recordings
      • General
        • Overview
        • Recording
        • System
      • Memory
        • Overview
        • GCs
        • GC Statistics
        • Allocation
        • Heap Contents
        • Object Statistics
      • Code
        • Overview
        • Hot Methods
        • Optimizations
      • Thread/Locks
        • Overview
        • Threads
        • Java Locks
        • JVM Locks
        • Thread Dumps
      • Latency
        • Overview
        • Log
        • Graph
        • Threads
        • Traces
        • Histogram
      • Using the Operative Set
    • Troubleshooting
    • Summary
  • Chapter 9: The Flight Recorder
    • The evolved Runtime Analyzer
      • A word on events
      • The recording engine
      • Startup options
        • Starting time-limited recordings
    • Flight Recorder in JRockit Mission Control
      • Advanced Flight Recorder Wizard concepts
    • Differences to JRA
      • The range selector
      • The Operative Set
      • The relational key
      • What's in a Latency?
      • Exception profiling
      • Memory
    • Adding custom events
    • Extending the Flight Recorder client
    • Summary
  • Chapter 10: The Memory Leak Detector
    • A Java memory leak
      • Memory leaks in static languages
      • Memory leaks in garbage collected languages
    • Detecting a Java memory leak
    • Memleak technology
    • Tracking down the leak
      • A look at classloader-related information
    • Interactive memory leak hunting
    • The general purpose heap analyzer
    • Allocation traces
    • Troubleshooting Memleak
    • Summary
  • Chapter 11: JRCMD
    • Introduction
    • Overriding SIGQUIT
      • Special commands
    • Limitations of JRCMD
    • JRCMD command reference
      • check_flightrecording (R28)
      • checkjrarecording (R27)
      • command_line
      • dump_flightrecording (R28)
      • heap_diagnostics (R28)
      • hprofdump (R28)
      • kill_management_server
      • list_vmflags (R28)
      • lockprofile_print
      • lockprofile_reset
      • memleakserver
      • oom_diagnostics (R27)
      • print_class_summary
      • print_codegen_list
      • print_memusage (R27)
      • print_memusage (R28)
      • print_object_summary
      • print_properties
      • print_threads
      • print_utf8pool
      • print_vm_state
      • run_optfile (R27)
      • run_optfile (R28)
      • runfinalization
      • runsystemgc
      • set_vmflag (R28)
      • start_flightrecording (R28)
      • start_management_server
      • startjrarecording (R27)
      • stop_flightrecording (R28)
      • timestamp
      • verbosity
      • version
    • Summary
  • Chapter 13: JRockit Virtual Edition
    • Introduction to virtualization
      • Full virtualization
      • Paravirtualization
      • Other virtualization keywords
      • Hypervisors
        • Hosted hypervisors
        • Native hypervisors
        • Hypervisors in the market
      • Advantages of virtualization
      • Disadvantages of virtualization
    • Virtualizing Java
      • Introducing JRockit Virtual Edition
        • The JRockit VE kernel
      • The virtual machine image concept and management frameworks
      • Benefits of JRockit VE
        • Performance and better resource utilization
        • Manageability
        • Simplicity and security
      • Constraints and limitations of JRockit VE
    • A look ahead—can virtual be faster than real?
      • Quality of hot code samples
      • Adaptive heap resizing
      • Inter-thread page protection
        • Improved garbage collection
        • Concurrent compaction
    • Summary

Marcus Hirt

Marcus Hirt is one of the founders of Appeal Virtual Machines, the company that created the Java Virtual Machine JRockit. He is currently working as Team Lead, Engineering Manager and Architect for the JRockit Mission Control team. In his spare time he enjoys coding on one of his many pet projects, composing music and scuba diving. Marcus has been an appreciated speaker on Oracle Open World, eWorld, BEAWorld, EclipseCon, Nordev and Expert Zone Developer Summit, and has contributed JRockit related articles and webinars to the JRockit community. Marcus Hirt got his M.Sc. education in computer science from the Royal Institute of Technology in Stockholm.

Marcus Lagergren

Marcus Lagergren holds a M.Sc. in computer science from the Royal Institute of Technology in Stockholm, Sweden. He has a background in computer security but has worked with runtimes since 1999. Marcus Lagergren was one of the founding members of Appeal Virtual Machines, the company that developed JRockit. Marcus has been team lead and architect for the JRockit code generators and has been involved in pretty much every other aspect of the JRockit JVM internals. Since 2007 Marcus works for Oracle on fast Virtualization technology. Marcus lives in Stockholm with his wife and two daughters. He likes power tools, heavy metal and scuba diving.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Oracle JRockit: The Definitive Guide +    Governance, Risk, and Compliance Handbook for Oracle Applications =
50% Off
the second eBook
Price for both: £37.30

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Get to grips with the fundamental building blocks of a JVM: the code generator, the garbage collector, and the implementation of threads and synchronization. Learn the design philosophy behind the JRockit JVM in these areas.
  • Become a better Java programmer through enhanced understanding of the Java runtime.
  • Learn how program execution works in an adaptive environment.
  • Create relevant benchmarks and accurately measure the performance of your Java application.
  • Learn the most important command-line flags that control JRockit subsystems and their use for performance tuning.
  • Get to know what JRockit Mission Control is, how to set it up, and how to trouble-shoot it.
  • Use the JRockit Management Console to monitor and manage a running JRockit instance.
  • Profile your JRockit JVM and Java application with near zero overhead using the JRockit Runtime Analyzer and the JRockit Flight Recorder.
  • Detect and resolve Java memory leaks using the JRockit Memory Leak Detector tool.
  • Learn how JRockit Virtual Edition works and why it outperforms other Java solutions in traditional virtualized environments.

In Detail

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.


Filled with careful step-by-step instructions and plenty of screenshots, this tutorial shows you JRockit and how to get the most from it. All key concepts in the JRockit JVM, such as code generation, memory management and other internals are introduced. Performance aspects of Java are discussed in detail. A complete guide to use the tools in the JRockit Mission Control suite is also included, and much more.

Who this book is for

This book is for intermediate to advanced Java Developers, who want to monitor, diagnose, profile and enhance the performance of their Java applications. It is also for people who want to understand more about the internal workings of a modern Java Virtual Machine or adaptive runtime. Parts of the book are suitable as course material for education about runtimes.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software