Java Application Performance Tuning and Memory Management

Discover how coding choices, benchmarking, performance tuning and memory management can optimize your Java applications

In this course we’ll understand what can cause performance issues in our applications, and how to resolve them. This includes a review of some of the options available to us as developers at design-time – how to make good coding choices for optimal performance. For example, when should you pick an ArrayList over a LinkedList? How much difference does the StringBuilder really make? Is Lambda syntax more or less efficient at certain operations?  We’ll also learn about various ways that we can configure the virtual machine to provide better performance at run-time, with a range of runtime arguments. We’ll also be diving deep into how the virtual machine manages memory, and how the garbage collection process works and impacts on application performance.

What you’ll learn

  • What can cause performance issues in our applications, and how to resolve them..
  • The choices available to us as developers at design-time – how to make good coding choices for optimal performance..
  • How to configure the virtual machine to provide better performance at run-time..
  • The JVM’s Just In Time compiler..
  • How the virtual machine manages memory..
  • Performance testing and benchmarking..

Course Content

  • Chapter 1 – Introduction –> 5 lectures • 14min.
  • Chapter 2 – Just In Time Compilation and the Code Cache –> 7 lectures • 37min.
  • Chapter 3 – Selecting the JVM –> 4 lectures • 23min.
  • Chapter 4 – How memory works – the stack and the heap –> 4 lectures • 22min.
  • Chapter 5 – Passing objects between methods –> 5 lectures • 20min.
  • Chapter 6 – Memory exercise 1 –> 2 lectures • 10min.
  • Chapter 7 – Escaping References –> 7 lectures • 44min.
  • Chapter 8 – Memory Exercise 2 –> 2 lectures • 12min.
  • Chapter 9 – The Metaspace and internal JVM memory optimisations –> 5 lectures • 21min.
  • Chapter 10 – Tuning the JVM’s Memory Settings –> 5 lectures • 30min.
  • Chapter 11 – Introducing Garbage Collection –> 7 lectures • 27min.
  • Chapter 12 – Monitoring the Heap –> 4 lectures • 23min.
  • Chapter 13 – Analysing a heap dump –> 2 lectures • 9min.
  • Chapter 14 – Generational Garbage Collection –> 5 lectures • 22min.
  • Chapter 15 – Garbage Collector tuning & selection –> 9 lectures • 36min.
  • Chapter 16 – Using a profiler to analyse application performance –> 10 lectures • 46min.
  • Chapter 17 – Assessing Performance –> 6 lectures • 26min.
  • Chapter 18 – Benchmarking with JMH –> 3 lectures • 13min.
  • Chapter 19 – Performance and Benchmarking Exercise –> 5 lectures • 21min.
  • Chapter 20 – How Lists Work –> 10 lectures • 34min.
  • Chapter 21 – How Maps Work –> 10 lectures • 34min.
  • Chapter 22 – Other Coding Choices –> 6 lectures • 24min.
  • Chapter 23 – GraalVM –> 6 lectures • 27min.
  • Chapter 24 – Using Other JVM Languages –> 3 lectures • 25min.
  • Chapter 25 – Course Summary –> 2 lectures • 3min.

Auto Draft

Requirements

In this course we’ll understand what can cause performance issues in our applications, and how to resolve them. This includes a review of some of the options available to us as developers at design-time – how to make good coding choices for optimal performance. For example, when should you pick an ArrayList over a LinkedList? How much difference does the StringBuilder really make? Is Lambda syntax more or less efficient at certain operations?  We’ll also learn about various ways that we can configure the virtual machine to provide better performance at run-time, with a range of runtime arguments. We’ll also be diving deep into how the virtual machine manages memory, and how the garbage collection process works and impacts on application performance.

Along the way we’ll be learning about the Just In Time compiler, performance testing and benchmarking, decompiling bytecode, using the GraalVM as an alternative virtual machine and more.

About Java Versions: This is the second iteration of this course and it is designed for all the current versions of Java that have long term support (Java 8 , Java 11 and Java 17). You can follow along with any of these versions. You can also use either the Oracle or the OpenJDK JVMs.  For developers using other JVM languages (such as Kotlin, Scala and Groovy) all of the JVM configuration parts of this course will still be relevant, and some of the coding choices may be useful to consider also. (Note that there’s even a review of whether Kotlin provides better or worse performance than Java!)

Get Tutorial