Java Profiling

What, How and Why?

Ufuk Uzun, December 2015


  • Profiling is a form of dynamic program analysis that measures, for example
    • Memory
    • CPU
    • ...

Java Profilers

  • Profile Java applications and allow us to
    • Monitor application performance and memory consumption
    • Monitor application threads
    • Analyze memory allocation
    • Take and display thread dumps

How Java Profilers work?

  • The JVM tool interface (JVM TI) is a native programming interface for use by tools
  • It provides both a way
    • to inspect the state
    • to control the execution of applications running in the JVM
  • JVM TI was introduced at JDK 5.0 and replaced JVMPI and JVMDI
  • Java Management Extensions (JMX) is the common communications layer

Popular Java Profilers

Survey which collected responses from over 1500 developers, testers, architects


  • The standard Java profiler
  • JDK 8 contains Java VisualVM tool based on VisualVM 1.3.6
    • From command line:
      $ jvisualvm

  • Or download lastest version from

VisualVM - Demo

Demonstration of using CPU Profiler & Call Trees to find slower methods than others


Java Profiling - What, How and Why?

By Ufuk Uzun

Java Profiling - What, How and Why?

Explains profiling and demonstrate CPU profiling using the standard Java Profiler VisualVM

  • 499