Shared archive coverage
The generated OpenAF launchers already use .shared.oaf through -XX:SharedArchiveFile. Run ./oaf --repack after updating the JAR or JDK to regenerate it with the launcher’s JVM settings, including compact object headers and module options. Archive generation does not change the JAR’s class path.
Repacking now executes a local OpenAF/oJob warmup with -XX:DumpLoadedClassList, then creates and validates an archive. It selects the first usable coverage level:
- Application: classes recorded by the warmup, including OpenAF classes.
- Platform: recorded JDK-module classes plus the JDK’s standard class list.
- Default: ordinary JVM archive generation if training or expanded coverage is unavailable.
The current repacked JAR has Class-Path: .. HotSpot rejects application archives when that entry points to a nonempty directory. The platform fallback improves coverage while preserving installation-directory Java classes and resources. Removing the manifest entry merely to enable application sharing would change existing behavior and is not part of this change.
The warmup loads libraries and runs a small in-memory job. Training subprocesses set openaf.cds.training=true to skip both user and embedded startup profiles, and use default OpenAF flags. Ordinary executions continue loading profiles. The helper obtains effective VM options from the generated launcher; when no launcher exists yet, it uses the current JVM’s settings. Repack again after generating launchers if those settings differ.
Archive creation alone does not establish that it can be used. Each candidate is checked with -Xshare:on -XX:+PrintSharedArchiveAndExit against the actual JAR and VM settings. Only a validated candidate replaces .shared.oaf, by an atomic move. If every candidate fails, the previous archive is preserved and repacking reports the failure. Under the generated launcher’s ordinary default sharing mode, a missing or incompatible archive permits normal JVM startup; explicitly requesting -Xshare:on instead makes an unusable archive fatal.
To inspect the archive through a generated Unix launcher:
OAF_JARGS='-XX:+PrintSharedArchiveAndExit' ./oaf -c '1'
To inspect actual sharing during an oJob execution:
OAF_JARGS='-Xlog:class+load=info:file=cds-classes.log' ./ojob job.yaml