The Hitchhiker’s guide to Java class reloading
summary
Compares three concrete approaches and demos working code: the JVM HotSwap path using Instrumentation.redefineClasses preserves instance state but only allows method-internal edits; class loader–based restarts via Spring Boot DevTools drop context and lose session state but restart in seconds; and an agent that watches file timestamps, attaches with the Instrumentation API, and replays transformations (splitting state and behavior) to add fields/methods and refresh Spring/Hibernate mappings. Shows an agent loader that attaches to a running process, live-reloads controllers and entities, and preserves counters during many edits.
AI-written summary · about
chapters (12)
- 0:00Intro
- 3:14The solutions
- 4:07Hotswap
- 9:31Theory
- 13:45Dynamic Code Evolution VM
- 16:43Annotations
- 18:32Class loaders
- 21:03Application servers
- 26:59Java agents
- 28:54Demo
- 36:39Example
- 44:10Conclusion
related talks
14mHow does code hot swapping work, and what are its pitfalls?
55mMaking Java more dynamic
24mAn Experiment in Continuous Deployment of JVM applications
45mMaking Java more dynamic
56mKeeping Your #Java Hot by Solving the #JVM Warmup Problem
01h 03mKeeping Your Java Hot.
48mCaching the Spring Context in Tests: How to Speed Up Testing
54mKeeping Your Java Hot by Solving the JVM Warmup Problem
