O'Reilly logo
live online training icon Live Online training

Memory Efficient Java

Stop Wasting Memory

Topic: Career Development
Kirk Pepperdine

When developers and operations are asked, "What is the biggest performance bottleneck in Java you face today?," the answers range from database access to garbage collection. While memory footprint is slowly starting to be recognized as being an issue, it is still rare that the issue of memory efficiency is raised. This lies in direct contrast to our findings that nearly 60% of the applications we’ve looked at in a wide variety of industries suffer from being memory efficient. And the performance penalty for not seeing or addressing this performance bottleneck can be huge. In some cases teams have experienced 4x improvements in application throughput with relatively simple improvements to the memory efficiency of their applications. As for footprint, reducing it can result in real costs savings for both cloud and on-prem deployments.

This training session will give focus on techniques to help you identify if your application is part of the 60%, how you can diagnose the dominate contributors to the problem and some techniques that can be used to improve memory efficiency and reduce memory footprints. Additionally we will look at some techniques that you can employ today to help make sure your application doesn’t become a member of the 60% club.

What you'll learn-and how you can apply it

  • Tools and techniques to recognize that memory inefficiency is the bottleneck in your application.
  • Tools and techniques to characterize and eliminate the root cause of the memory inefficiency.
  • Tools and techniques to reduce memory footprint.
  • Coding patterns that ensure your application is and will remain to be memory efficient.

This training course is for you because...

  • Junior and intermediate Java programmers wanting to better understand collections
  • Advanced programmers who want to pick up that extra 10% that will put them above their colleagues
  • Operations and support staff that want a better understanding of memory efficiency in Java and the JVM


  • Attendees should have experience coding in Java and language features up to Java 11.

Course Set-up?

Recommended Preparation

  • Live Online Training: Solving Java Memory Leaks, by Kirk Pepperdine: Search the O’Reilly Learning Platform for an upcoming date

Recommended Follow-up

About your instructor

  • Kirk has been performance tuning Java applications for over 20 years. Frequent speaker at JUGs and conferences worldwide and has been named a JavaONE rockstar numerous times. Kirk authored the original Java performance tuning workshop and jPDM, a performance diagnostic model. This model is the core of the diagnostic engine developed by JClarity, a startup cofounded by Kirk.

    In 2006 Kirk was named as a Java Champion. More recently he has named as part of the Oracle groundbreakers and InfoQ influencers. Kirk continues to be an ardent support of the Java community cofounding JCrete, a Java unconference and by helping other establish Java (un)conferences worldwide.


The timeframes are only estimates and may vary according to how the class is progressing

Segment 1 Introduction (75min)

  • Memory complexity and why it matters
  • Methods to find applications suffering from high allocation rates
  • Structure of Java Heap
  • Allocation in Java Heap
  • Garbage Collection basics
  • JIT and GC memory optimizations

Break (10 Min)

Segment 2 Tooling (40min)

  • Finding hot allocators with VisualVM
  • Comparing profiling results with JITWatch
  • Finding hot allocators with JFR

Break (15 min)

Segment 3 Reducing Java Heap Footprint (40 min)

  • Why Reduce Java Heap’s footprint
  • Heap reduction with VisualVM
  • Heap reduction with MAT

Break (10 min)

Segment 4 - Wrap-up (15min)

  • Q&A session