4D Training & Consultancy

Software Development

JVM Performance Tuning and Troubleshooting

An advanced diagnostics course for engineers who own Java systems in production. Participants measure before they tune, examining memory layout, garbage collection behaviour, thread contention, and allocation pressure with Flight Recorder, heap dumps, and benchmarks rather than flags copied from a forum thread.

4 daysIn-house, online, or customized deliveryCorporate teams and professional groupsLevel: Advanced

Overview

Practical learning for workplace transfer.

Most Java performance work fails for one reason: the team changes flags before it knows where the time goes. Heap sizes are raised to hide a leak, a collector is switched to solve a lock contention problem, capacity is doubled to absorb an allocation defect, and a benchmark measures JIT warm-up rather than the code under test. This course establishes measurement discipline first. Participants read garbage collection logs and Flight Recorder profiles, analyse heap dumps to locate retained objects, diagnose contention and thread starvation from thread dumps, and choose deliberately between throughput and latency with numbers that defend every change they propose.

Prerequisites

Several years of Java development or operations experience and familiarity with running Java applications in a server environment.

Objectives

  • Interpret JVM memory structure, allocation behaviour, and garbage collection logs.
  • Select and size a collector, G1, ZGC, or Parallel, against a stated latency or throughput goal.
  • Profile CPU, allocation, and lock contention with JDK Flight Recorder and Mission Control.
  • Analyse heap dumps to identify leaks, retained sets, and the true owner of memory.
  • Diagnose thread starvation, deadlocks, and pool exhaustion from thread dumps under load.
  • Design benchmarks that account for JIT warm-up and produce numbers worth acting on.

Target audience

  • Senior Java engineers accountable for production performance
  • Site reliability and platform engineers operating JVM workloads
  • Application architects setting latency, capacity, and cost targets
  • Performance engineers and load testing specialists
  • Support engineers handling escalated production incidents
  • Technical leads answerable for the infrastructure cost of Java services

Program outline

A clear structure for the learning journey.

Program outline

Outline points are grouped in one designed block instead of being treated as separate module cards.

Module 1: JVM Internals and the Real Cost of an Object

Runtime memory areas: heap, metaspace, thread stacks, and native memory

Object layout, header size, and what an allocation actually costs

JIT compilation tiers, inlining, and why early measurements mislead

Escape analysis, deoptimization, and the limits of what the compiler can fix

Module 2: Garbage Collection Behaviour and Collector Selection

Generational collection, regions, and how pause time is actually produced

G1 tuning: region sizing, pause targets, and humongous allocations

ZGC and low-latency collection: the cost in throughput and footprint

Reading GC logs to separate a sizing problem from a genuine leak

Module 3: Memory Leaks and Heap Analysis

Capturing heap dumps safely from a live production instance

Dominator trees, retained size, and locating the object that holds memory

Classic leak sources: caches, thread locals, listeners, and class loaders

Off-heap and native memory growth that never appears in the heap

Module 4: Profiling with Flight Recorder and Mission Control

Enabling continuous JFR recording at an overhead production can accept

Reading CPU, allocation, and I/O profiles together rather than in isolation

Event settings, custom events, and recording an incident as it happens

Turning a profile into a ranked list of changes actually worth making

Module 5: Concurrency, Contention, and Thread Behaviour

Thread dumps: deadlocks, blocked threads, and exhausted pools

Lock contention, false sharing, and contended synchronization events

Executor sizing, queue depth, and back pressure under sustained load

Virtual threads: which workloads gain and which get measurably worse

Module 6: Benchmarking, Tuning Decisions, and Capacity

JMH benchmarks that survive warm-up, dead-code elimination, and noise

Latency percentiles, coordinated omission, and honest reporting to stakeholders

Container limits, CPU shares, and JVM ergonomics under cgroups

Recording a tuning decision so the team can revisit it with evidence

Materials provided

  • Course workbook, annotated code samples, and reference notes
  • Hands-on lab environment and starter repositories
  • Exercises, checklists, and reusable code templates
  • 4D Certificate of Completion
  • Post-course technical guidance

Training Options

Programs can be delivered in-house, online, or in a blended format depending on your team's schedule, location, and learning objectives. When an external certificate or exam is included, certification rules and fees remain under the relevant awarding body's policies, while 4D provides the training and preparation support.

Why choose 4D

4D teaches this course on instrumented workloads instead of slides: participants deliberately induce leaks, contention, and pause-time regressions, then hunt them with the same tooling they will reach for at three in the morning. Where you can supply them, trainers work from your own GC logs and recordings so the tuning decisions leave the room already applied.

Speak to 4D

Plan the right training or consultancy path for your team.

Share a few details and 4D will help route your inquiry toward corporate training, consultancy, assessment, Phoenix-enabled support, or a tailored program.