Boosting JRuby Startup with AppCDS and AOT caching – Charles Oliver Nutter – Java, Ruby, and JVM guy trying to make sense of it all

21-Feb-2025 14
I’m still ramping up my blogging efforts, but I wanted to share the results of recent experiments using JRuby with Application Class Data Store and the new AOTCache feature being previewed in JDK 24 Around the times of Java 1.7 or 1.8, teams at Sun (and then Oracle) started shipping a JDK feature called Class Data Sharing (CDS). This was a new, specialized cache file that could be used to “pre-load” much of the runtime metadata from starting a JVM-based application. Initially, this only included the JDK’s own class metadata, but by JDK 10 a new version of the feature was made available: Application CDS, basically a Class Data Store for your own applications. We have experimented with this feature in JRuby over the years, but the user experience has been cumbersome and the file can get stale if you reinstall JRuby or switch to a different JDK. That appears to be improving with recent JDK releases.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle