This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Executable size problem
- From: Anthony Green <green at redhat dot com>
- To: Andrea aime <andrea dot aime at aliceposta dot it>
- Cc: java at gcc dot gnu dot org
- Date: Sat, 07 Jan 2006 09:01:07 -0800
- Subject: Re: Executable size problem
- References: <dpof3c$tg5$1@sea.gmane.org>
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