openjdk-docker
openjdk-docker copied to clipboard
symbol stripping
This proposes a review of symbol stripping. Symbols aid diagnostics but take up space.
I had a brief look at adoptopenjdk/openjdk11:x86_64-alpine-jdk-11.0.6_10
and adoptopenjdk/openjdk11:x86_64-alpine-jdk-11.0.6_10-slim
.
https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/slim-java.sh#L247
libjvm.so
stripped is around 18MB, full is 22MB. A 20% difference. But when compared with other file sizes - largest /opt/java/openjdk/lib/modules
at 135MB, the increase is not so significant.
https://github.com/AdoptOpenJDK/openjdk-docker/blob/8e8420ea8dbe9f4a39cf23d0930725d3ba9f0a79/11/jdk/alpine/Dockerfile.hotspot.nightly.slim#L39 https://github.com/AdoptOpenJDK/openjdk-docker/blob/8e8420ea8dbe9f4a39cf23d0930725d3ba9f0a79/11/jdk/alpine/Dockerfile.hotspot.nightly.full#L39 As the files a stripped in both full and slim and I haven't built from source I don't know how much space the symbols are taking. In the context here the troubleshooting value may be more than the space saving on these 2 files. Resolving #317 may provide some space for symbols to be retained.
I don't have the full numbers, the image sizes etc, but it appears that it may be possible to retain symbols without significantly bloating the slim image size.
@ceeaspb What's your use case for wanting symbols in the slim builds?