You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Trim the bundled JRE: drop java.desktop, jdk.jfr, java.compiler and strip native libraries (-13 MB per wheel) #447
The wheel's bundled jlink runtime carries three JDK modules that no shipped code path uses: java.desktop (which also brings java.datatransfer and java.prefs), jdk.jfr and java.compiler. Dropping them takes the compressed runtime from 40.9 MB to 29.3 MB (-11.6 MB), and stripping the native libraries (libjvm.so ships with its symbol table) takes it to 27.8 MB (-1.7 MB more on Linux). The Linux x86_64 wheel goes from 80.8 MB to 67.7 MB (measured 2026-10-22, same jars, 20 modules down to 15).
The module list is not hand-written: scripts/Dockerfile.build (linux/amd64, linux/arm64) and scripts/build-native.sh (macOS, Windows) run jdeps --print-module-deps over the jars and add jdk.management,jdk.zipfs,jdk.unsupported,jdk.incubator.vector. jdeps lists the three modules because of optional users, so the fix is an explicit exclusion applied to that list in both scripts, plus a post-jlink check that no excluded module came back in transitively.
What jdeps finds for the three modules over the shipped jars (62 jars analysed, the same set the build analyses):
java.desktop: org.locationtech.jts.awt.* in jts-core (AWT shape readers and writers, never called by ArcadeDB), java.beans in jackson-databind (Java7SupportImpl: @ConstructorProperties, @Transient, optional by design), snakeyaml (MethodProperty introspector, unused by jackson-dataformat-yaml, which uses only the parser and emitter), commons-lang3 (AbstractCircuitBreaker), commons-math3 (geometry.euclidean.twod.Line), micrometer (Log4j2Metrics, loaded only with Log4j2), jakarta.xml.bind-api (JAXB convenience class, not referenced by any shipped class), jakarta.activation-api (DataHandler, which needs java.datatransfer, not referenced by any shipped class). No class outside the named one refers to any of these (checked on the constant pools of all shipped classes, multi-release entries included).
jdk.jfr: only com.arcadedb.utility.JVMGCHistogramReporter in the engine, which nothing in the repository references (no caller, no reflective name, no command).
java.compiler: only org.agrona.generation.* (agrona's run-time code generator), which no shipped class refers to.
Plan, in one PR: exclude the three modules in both build scripts, add a runtime check to the jar closure test (tests/test_jar_closure.py) so a shipped class that refers to a package of a module the runtime lacks fails the suite unless it is listed with a reason, strip the Linux runtime's .so files, update the docs that name the bundled modules and the wheel size, and gate on the full bindings suite and the examples run on a freshly built wheel.
Activity