Garbage Collection and Memory Management on the JVM

Learn how to diagnose and tune memory management issues

Get in touch

Garbage Collectors help us reduce the programming overhead of solving memory management issues. As a developer, this is great but GCs aren’t a complete solution to the memory management problem. This course gives you a solid understand of how to monitor and tune memory management of your applications as well as overview of state of the art GC techniques.

You will start the course by talking through some common issues with how GCs work and different performance considerations that we need to understand. You then learn about how the three most commonly used GC implementations in Oracle Java/OpenJDK work, how to monitor their behaviour and tune/optimise them. The course then moves on to other common programmer focused memory management issues. You’ll learn about to use memory profiling and heap dumps to analyse misbehaving Java applications and bring them under control.

Duration: One day

Course Outline

Introduction to Garbage Collection

  • What does a Garbage Collector do?
  • Overview of Different Collectors
  • GC Performance Tradeoffs: Throughput and Pause Times
  • Generational GC
  • Other GC Approaches ­ Zing, Shenandoah
  • Monitoring GC Problems: MXBeans and GC Logs


  • The Parallel GC Algorithm
  • Using Parallel GC for Throughput
  • Tuning Parallel GC
  • Case Study

Concurrent Mark Sweep (CMS)

  • The CMS Algorithm
  • Using CMS for Low Pause Times
  • Tuning CMS
  • Case Study

Garbage First (G1)

  • The G1 Algorithm
  • Using G1 GC for Large Heaps or Low Pause Times
  • Tuning G1
  • Case Study

Common Problems and Solutions

  • Insufficient Memory
  • Memory Leaks
  • When to GC Tune
  • Understanding Allocation Rates
  • Premature Promotion
  • Object Nepotism
  • Case Study

Memory Profiling

  • What is memory profiling?
  • Finding Allocation Hotspots
  • Detecting Memory Leaks through Generational Counts
  • Tooling: Java Mission Control and VisualVM
  • Case Study: reducing object allocation rates

Memory Usage Analysis

  • What is a Heap Dump?
  • Object Histograms
  • Understanding Heap Memory Consumption
  • Querying Heap Dumps
  • Understanding Memory Leaks from Heap Dumps
  • Case Study: Finding a Memory Leak

Schedule this course

Let us know your requirements and we will craft a tailored proposal for your team.

Drop us a line with a phone number to call back at

You can also give us a call directly on +44 7931 144 219