How to trim some more fat OpenJDK 8

Medi Montaseri medi.montaseri at hds.com
Thu Feb 27 03:22:46 UTC 2014


Hi,

I am building OpenJDK 8 for a tight environment and would like to have a very small JDK (or I should say JRE) footprint....sort of like headless but even more.

I would like to do this from the configure(1) as much as possible. And then resort to rm(1).

Here is build result on amd64 Debian 7.3 without any trimming

mmontaseri at griffin:~/work/bug-91383/openjdk8> du -sh *
168K    bin                           # these are all symlinks to jvm/bin
269M    jvm

too much...I need to get down to under 30 Meg. So I build again with
configure --disable-headful --disable-debug-symbols --disable-zip-debug-info
and I get the following result

mmontaseri at griffin:~/work/bug-91383/depot2> du -sh *
168K    bin
168M    jvm                   # went down from 296M to 168M

That is good, but not good enough....I then looked around and found about 66 Meg of *.diz files. We don't need these.

Q1- is there any configure option to not produce *.diz files (gdb debug info for .so files). If not, then I have to rm(1) them.

Q2- I see two lib directories under jvm/openjdk-1.8.0-internal
mmontaseri at griffin:~/work/bug-91383/depot2/jvm/openjdk-1.8.0-internal> du -sh jre/*
4.0K    jre/ASSEMBLY_EXCEPTION
272K    jre/bin
97M     jre/lib
20K     jre/LICENSE
180K    jre/THIRD_PARTY_README
mmontaseri at griffin:~/work/bug-91383/depot2/jvm/openjdk-1.8.0-internal> du -sh lib
38M     lib
Can you help me understand the difference between lib/* and jre/lib

I see debian has created a set of packages on OpenJDK 7, like so
ii  openjdk-7-jdk:amd64                           7u25-2.3.10-1~deb7u1                    amd64        OpenJDK Development Kit (JDK)
ii  openjdk-7-jre:amd64                           7u25-2.3.10-1~deb7u1                     amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless:amd64                  7u25-2.3.10-1~deb7u1                amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                             7u25-2.3.10-1~deb7u1                           all              OpenJDK Java runtime (architecture independent libraries)



thanks
Medi



More information about the build-dev mailing list