~/talk

Writing a Java Profiler in Pure Java

Talkat code.talks 2023 · 2023-09-14..09-15· [java]
slides:none on file

A working Java sampler runs concurrently inside the JVM, collects stack traces via Thread.getAllStackTraces, aggregates them into a compact tree and emits flame graphs; a usable prototype fits in 240 lines of pure Java and users report 2–5% overhead depending on settings. Typical fixes shown include switching JSON file I/O to SQLite which eliminated the main-loop stall. Demos cover async-profiler, JFR/JDK Flight Recorder and an IntelliJ JFR plugin that links recorded events to source lines.

AI-written summary · about

  1. 0:00Introduction
  2. 3:06What profiling is
  3. 6:15Who am I and why write a profiler
  4. 8:03Instrumenting vs sampling
  5. 9:28Building a Java profiler
  6. 11:36Java agents and JVM
  7. 13:00Sampling stack traces
  8. 14:25Flame graphs from traces
  9. 16:09Existing profiling tools
  10. 17:33Async profiler API
  11. 19:23Profiler risks
  12. 20:50Async profiler config
  13. 21:52Java Flight Recorder
  14. 23:21Custom JFR events
  15. 25:10Analyzing profiles with JMC
  16. 27:16JFR plugin for IntelliJ
  17. 28:45Sampling limitations
  18. 29:29Profiling performance impact
  19. 30:34Continuous profiling tools
  20. 32:03Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.