How? You need to specify a list of which
methods in which
classes should be compiled. This isn't easy to generate but you can start with:
- -XX:+UnlockDiagnosticVMOptions
- -XX:+LogTouchedMethods
- -XX:+PrintTouchedMethodsAtExit
...then massage this data with grep and/or sed... Then you have to pass this list to jaotc which compiles your bytecodes into a Shared Object file. Not easy, maybe worth it though.
More anec-data: I found that using CDS, AppCDS and AOT all at once cut the startup time for a Clojure application by over 60%. YMMV, of course.