openj9

Java9 linking and OpenJ9


One of the coolest feature in java 9 modules is the ability to prepare a very optimize JRE+modules bundle, a process during which several optimization techniques can be applied. Although not implemented yet, the HotSpot team is planning on AOT compilation during this phase.

What is the OpenJ9 "bag of tricks" and optimizations for this linking phase?


Solution

  • There's a lot of overlap between JLink and OpenJ9's SharedClasses cache technology. SharedClasses allows saving the J9ROMClass (a reorganized better version of the class file structure) into a shared memory area. It also allows dynamic AOT code along with JIT hints and profile data to be stored for later runs.

    We've looked at moving some of the functionality from SharedClasses into JLink and will continue to investigate these areas further.

    Additionally, we've looked at ways to optimize the class data when creating jlinked images, removing unneeded methods, fields, etc, due to the possibility of a closed world.

    Finally, we've implemented a Small Footprint JVM jlink plugin to create small images similar to the IBM J9 SFJ package.