Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Compression used in Sun's JDK/JRE downloads?

Reply
Thread Tools

Compression used in Sun's JDK/JRE downloads?

 
 
Guest
Posts: n/a
 
      04-15-2007

How does sun get their compressed archive of Java binaries down to 15MB?
When I uncompress these and then 'zip' or 'tar czf' the resulting file
is 25MB, even using maximum compression flags.

NM
 
Reply With Quote
 
 
 
 
Tom Hawtin
Guest
Posts: n/a
 
      04-15-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> How does sun get their compressed archive of Java binaries down to 15MB?
> When I uncompress these and then 'zip' or 'tar czf' the resulting file
> is 25MB, even using maximum compression flags.


Since 1.2.2(?) they have something similar to pack200. If you were to
dig up a copy of 1.2.1, you should find it much larger.

Instead of individually compressing a large set of files each with
duplicate data (signature strings, for example), a single file is
produced that shares data between classes. This file can then be
compressed as a single stream.

For more information, google 'pack200'.

Tom Hawtin
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      04-17-2007
Tom Hawtin wrote:
>> How does sun get their compressed archive of Java binaries down to 15MB?
>> When I uncompress these and then 'zip' or 'tar czf' the resulting file
>> is 25MB, even using maximum compression flags.

>
>Since 1.2.2(?) they have something similar to pack200. If you were to
>dig up a copy of 1.2.1, you should find it much larger.


Doesn't look like they're using the pack200 distributed with the
jdk, that creates archives that are 48% of original size. No real
difference from gzip.

Sun's jdk.*.bin downloads are 39% of the original size. The only
tool does better is lzma, which creates archives that are 34% of the
original size.

# sh jdk-1_5_0_11-linux-amd64.bin && du -bs jdk1.5.0_11
113483747 jdk1.5.0_11

# jar cMf jdk1.5.0_11.jar jdk1.5.0_11 && du -bs jdk1.5.0_11.jar
55557396 jdk1.5.0_11.jar (49% of original size)

# tar czvf jdk1.5.0_11.tgz jdk1.5.0_11 && du -bs jdk1.5.0_11.tgz
54730784 jdk1.5.0_11.tgz (48% of original size)

# pack200 -J-Xmx500M -S-1 -E9 x.pack.gz jdk1.5.0_11.jar && \
# du -bs x.pack.gz
54622334 x.pack.gz (48% of original size)

# du -bs jdk-1_5_0_11-linux-amd64.bin (Sun original)
43930095 jdk-1_5_0_11-linux-amd64.bin (39% of original size)

# tar cvf - jdk1.5.0_11 | lzma -9 > jdk1.5.0_11.tar.lzma && \
# du -bs jdk1.5.0_11.tar.lzma
39714345 jdk1.5.0_11.tar.lzma (34% of original size)


Since Sun's shar files contain self-extracting SFX archives they must have
some custom software that can be decompressed with gzip/unzipsfx.

NM

 
Reply With Quote
 
Tom Hawtin
Guest
Posts: n/a
 
      04-17-2007
(E-Mail Removed) wrote:
> Tom Hawtin wrote:
>> Since 1.2.2(?) they have something similar to pack200. If you were to
>> dig up a copy of 1.2.1, you should find it much larger.

>
> [...]
>
> # pack200 -J-Xmx500M -S-1 -E9 x.pack.gz jdk1.5.0_11.jar && \
> # du -bs x.pack.gz
> 54622334 x.pack.gz (48% of original size)


I'm not particularly surprised pack200 on the installer doesn't work too
well. It's not going to comprise of all the class files in a ready to
run state, so pack200 wont help. Running it on rt.jar might give you
better figures. Also, IIRC, the JDK contains some debugging info (such
as line numbers) whereas the JRE does not. Presumably there is not a
great deal of point optimising pack200 to deal with debugging
information efficiently.

Tom Hawtin
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am buying all of the below Cisco equipment USED OR NEW. NOTE someline items say new or used, but I will buy them in both conditions. network buyer VOIP 0 12-23-2010 01:26 AM
Can Groovy be used in an applet and/or can it generate the Java bytecodes that then can be used in an applet? Casey Hawthorne Java 1 03-18-2009 12:56 AM
Is there a perl package, or data in a form easily used by a perlscript, that can be used to determine when to change to or from daylightsavings time? Ted Byers Perl Misc 23 11-15-2008 05:53 PM
fast universal compression scheme and its implementation in VHDL Jens Mander VHDL 0 06-10-2005 06:28 AM
Unreadable file on Canon S 400.I used a I used a Joseph Miller Digital Photography 3 01-13-2004 09:40 PM



Advertisments