Presented at JavaOne 2017 [CON4027], this presentation takes a practical, hands-on look at Java performance tuning. It discusses methodology (spoiler: it’s the scientific method) and how to apply it to Java SE systems (on any budget). Exploring concrete examples with tools such as the Oracle Java Mission Control feature of Oracle Java SE Advanced, VisualVM, YourKit, and JMH, the presentation focuses on ways of measuring performance, how to interpret data, ways of eliminating bottlenecks, and even how to avoid future performance regressions.
A separate version will be uploaded with speaker notes.
7. this talk
Part 1: theory
• challenges
• methodology
• implementation
Part 2: practice
• how to use a profiler
• hands-on jmh benchmarks
8. this talk
is not about gc tuning
Part 1: theory
• challenges
• methodology
• implementation
Part 2: practice
• how to use a profiler
• hands-on jmh benchmarks
12. Methodology
find a (proxy) metric for
implement
automate
“success”
a way of measuring it
a way of monitoring it
13. implementation
make it easy to
find root causes using
fix and add regression
tests using
learn to use and
understand
reproduce issues
production metrics
macro benchmarks
micro benchmarks
profilers
14. implementation
make it easy to
find root causes using
fix and add regression
tests using
learn to use and
understand
if the going gets tough
reproduce issues
production metrics
macro benchmarks
micro benchmarks
profilers
-XX+UnlockDiagnosticVMOptions
-XX:+LogCompilation
-XX:+PrintAssembly
19. A STORY OF ATAN
a (redacted) real world performance
tuning adventure involving my love for
math and some short-sightedness
it’s too
slow
let me try to profile it
20. To profile a production system, start your server with the JVM argument:
-agentpath:<profiler directory>/bin/linux-x86-64/libyjpagent.so
stack telemetry (Yourkit)