You are viewing content from a past/completed QCon -

Presentation: How the HotSpot and Graal JVMs execute Java Code

Track: Evolving Java

Location: Windsor, 5th flr.

Duration: 4:10pm - 5:00pm

Day of week: Wednesday

Slides: Download Slides

This presentation is now available to view on

Watch video with transcript

What You’ll Learn

  1. Hear about how Java works under the hood.
  2. Learn about the differences between Hotspot and GraalVM.


When Java was released in 1995 it was slow, a reputation it has carried for many years… Today Java can give performance that is comparable to C++ and can emit instructions that are more optimal than code which is statically compiled. But how?  

This talk will explore practical examples and the subsystems that are involved in interpreting, compiling and executing a simple Hello World Application. We will dive into JIT compilation and the arrival of the JVM Compiler Interface (JVMCI) to explore how optimisations are applied to boost the performance of our application. We will discuss HotSpot, explore Graal and the JVM ecosystem to discover performance benefits of a platform 25 years in the making.


What is the work you're doing today?


I work at Morgan Stanley as a Java developer and architect. My main work is around APIs and API gateways. That includes working on architectural components like our cloud strategy, building API infrastructure and all kinds of Java related projects along the way. Besides focusing on the architecture side of things I'm still actively involved in writing code, building gateways in Java using Spring Cloud Gateway and previous Apache Camel.

The other side of what I work on is my interest in Java as a platform and as a language. A few years ago I worked on a book with Ben Evans and Chris Newland called Optimizing Java. I would class myself as working on two things: my day job and then my hobby, which is tinkering with Java and the Java ecosystem. I’m also a big supporter of Open Source and have made several commits to Apache Maven.


What are your goals for the talk?


I've been working on a talk which I started four or five years ago when I was teaching graduate students with Ben Evans around what happens with Java code and what happens within the Java virtual machine. Initially, it was exploratory learning for myself, I’m a big believer that to teach something you have to really understand it. As it evolved into more of a complete talk, I started to build more demos and examples to learn about more things myself. It was also where the idea for what eventually became the book Optimizing Java was coined.

I started to explore how class loading works, how the JIT compiler kicks in and applies different optimizations. My goal is to take attendees on a tour from writing code all the way through to what happens within the JIT compiler. Now, that's obviously a very interesting space in Java, purely because of the way that JIT compilation is changing, changing from the use of Hotspot towards the use of Graal. I want to compare and contrast between the two different mechanisms, show a couple of live examples so people can really get a flavor of what is actually going on under the hood and how that has changed over the years.

My goals for the talk is to help take a peek under the hood of what we often take for granted. I want to share a journey through the different subsystems and give people an overview that they can hopefully go away with and learn something along the way and know how to get stuck in themselves.


What do you want people to leave the talk with?


James Key takeaways would be understanding of Java as a platform and how developers can explore this themselves. I want people to understand how the JVM works, the different subsystems work along the way, and to get an introduction and an understanding to JIT compilation and the differences between Hotspot and Graal.

Speaker: James Gough

Co-author of Optimizing Java

James (Jim) Gough is an executive director and developer at Morgan Stanley, where he’s focused on building customer-facing technology. A Java developer and author, Jim first became interested in Java during his degree program at the University of Warwick; after graduating, he became a member of the London Java Community. Community has remained central to Jim’s contributions, which include working on the design and testing of JSR-310 and serving on the Java Community Process Executive Committee for several years. Jim’s a regular conference speaker and spent four years teaching Java and C++ around the world.

Find James Gough at

2020 Tracks

  • Monday, 8 March

  • Tuesday, 9 March

  • Wednesday, 10 March