This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: size reduction


On Fri, 2003-02-21 at 19:45, Hendrik Schreiber wrote:
> Hi Folks,
> 
> I am currently evaluating gcj. We are developing java software for small devices and consider switching to gcj instead of deploying a vm to the device. One of the biggest problems with the small device VMs is size... they are simply to big. However, I gave gcj a shot and compiled a simple HelloWorld on Win2000 with Cygwin, which produced a 2.1mb executeable with default parameters.
> I am sure that the size of this can be reduced, but unfortunately I don't know a lot about gcc. Can someone please point me at ways to reduce the size? What can I expect as the minimum size for a 'standalone' executable?
> 
> Thanks - your help is appreciated!
> 
> -hendrik

If you compile gcj, use --disable-interpreter when configuring. It may
help a little.

But please consider that your executable contains a complete runtime
environment. 2.1 MB is pretty amazing, i think. I have two projects
cooking with gcj, compiled for win2k, each with 200.000+ lines of code.
They are both less than 3MB big. I have the interpreter enabled...
Unless you're really low on memory (may happen, I know), GCJ does a
great job, in performance and size. Compared to legacy jre's GCJ is far
better in my opinion.

The problem on windows is the need for static executables. If the
runtime was shared the size would be next to nothing. It's been done, by
Anthony Green :
http://gcc.gnu.org/ml/java/2002-12/msg00287.html


/Lars Andersen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]