Executable size problem

Anthony Green green@redhat.com
Sat Jan 7 17:09:00 GMT 2006


On Sat, 2006-01-07 at 14:18 +0100, Andrea aime wrote:
> Now, the main problem so far is the size of the generated executables.
> A "hello world" style app is 8MB (or 5, is you strip it).
> I've seen that micro-libgcj can be used to generate small executables,
> but most of the platform I rely on usually is stripped out (I develop
> Swing apps, web apps, Eclipse RCP apps and the like usually).

The most sophisticated tool I remember for reducing static binary size
was from Adam Megacz.  I'm pretty sure he released the code for it but I
couldn't find it (after only a single google attempt).

Here's a reference to it:
http://gcc.gnu.org/ml/java/2002-02/msg00202.html

It sounds wild:
  "Yeah, it's actually a Java program that does reachability analysis on
  the bytecode version of your program, and then spews out a linker
  script that will drop the unreachable methods. It also has some hacks
  to know what methods inside libgcj are invoked by native methods. I
  got HelloWorld down to 133kb gzipped."

If you search and find any more references to this (or contact Adam),
post your findings to this list.

Thanks,

AG





More information about the Java mailing list