Module 07
Java Performance Engineering
Find and fix bottlenecks the way high-scale teams do: measure, profile, reduce memory footprint and tune, with real case studies.
By the end of this module you can
- Measure before optimising, with the right metrics and tools
- Find CPU, memory, I/O and contention bottlenecks
- Reduce memory footprint and GC pressure in real code
Performance mindset
Latency, throughput, percentiles and measuring first.
- Latency vs throughputFreeSoon
- Percentiles and tail latencyFreeSoon
- Measure first: a performance workflowFreeSoon
- Little's law and capacityPremiumSoon
- Performance mindset: interview questions & scenariosPremiumSoon
Finding bottlenecks
Recognising CPU, memory, I/O, contention and GC problems.
- CPU-bound bottlenecksPremiumSoon
- Allocation and memory bottlenecksPremiumSoon
- I/O-bound bottlenecksPremiumSoon
- Lock contentionPremiumSoon
- GC pausesPremiumSoon
- Finding bottlenecks: interview questions & scenariosPremiumSoon
Tooling
Profilers, flame graphs and benchmarking done right.
- Java Flight Recorder and Mission ControlPremiumSoon
- How to read a flame graphFree
- async-profiler in practicePremiumSoon
- jcmd, jstat and VisualVMPremiumSoon
- Benchmarking with JMHPremiumSoon
- Tooling: interview questions & scenariosPremiumSoon
Memory footprint
Making the same work use less memory.
- Object overhead and compressed oopsPremiumSoon
- Boxing vs primitivesPremiumSoon
- Sizing collectionsPremiumSoon
- String memory optimisationsPremiumSoon
- Off-heap memoryPremiumSoon
- Memory footprint: interview questions & scenariosPremiumSoon
CPU & JIT
Writing code the JIT can optimise.
- JIT-friendly codePremiumSoon
- Inlining and megamorphic callsPremiumSoon
- False sharingPremiumSoon
- CPU & JIT: interview questions & scenariosPremiumSoon
Concurrency performance
Scaling with threads instead of fighting them.
- Reducing contentionPremiumSoon
- Tuning thread poolsPremiumSoon
- Virtual threads for I/O-heavy servicesPremiumSoon
- Concurrency performance: interview questions & scenariosPremiumSoon
I/O & serialization
The hidden cost of I/O, JSON and connections.
- Buffering and batching I/OPremiumSoon
- Serialization and JSON costsPremiumSoon
- Connection poolsPremiumSoon
- I/O & serialization: interview questions & scenariosPremiumSoon
GC tuning
Heap sizing, pause goals and allocation rate.
- Java memory management: heap, G1 and the signals that matterFree
- Heap sizingPremiumSoon
- Pause-time goalsPremiumSoon
- Allocation rate and GC pressurePremiumSoon
- GC tuning: interview questions & scenariosPremiumSoon
Case studies
Real incidents from symptom to root cause to fix.
- Case study: the slow endpointPremiumSoon
- Case study: memory keeps growingPremiumSoon
- Case study: the CPU spikePremiumSoon
- Case study: thread pool exhaustionPremiumSoon
- Case studies: interview questions & scenariosPremiumSoon
Module interview question bank
Finish the module
Module interview question bankEvery interview question worth practising for Java Performance Engineering, grouped by topic, with model answers, how to say them and what-if follow-ups.