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: Binary size of statically linked java application


Andrew Haley wrote:
Marco Trudel writes:
> Mohan Embar wrote:
> > Hi All,
> > > >> I usually remove AWT/Swing (the whole GUI stuff) and the whole > >> javax.crypto stuff. Then a real application is about 4.5mb (stripped of > >> course).
> > > > I'm not clear on why this would work given that the linker is supposed
> > to strip out unused code.
> > Well, I'm not talking about objects that won't be pulled into the final > binary (as you said, that wouldn't make sense). I'm talking about the > ones that will but are actually not really needed... From my FAQ:
> > Why are the binaries so big? With GCJ X.Y.Z, they were way smaller...
> As GCJ evolves, it supports more and more classes of the Java API. The > problem now is, that the Java API classes are heavily interconnected; a > simple "Hello World" application uses the security manager which uses > AWT which uses... Because of this, you will always have a big part of > the GCJ library in your binaries.
> For Java, this is not a problem. Endusers require to have the JVM, thus > having all classes anyway. For GCJ, this is a bigger problem because > it's not just a bug that can be fixed. The design of Java doesn't fit > into the concept of native compilation (concerning the size of binaries).


Eh?  Sure it does.  With the classical Java virtual machine you have a
bunch of libraries in .jar files, and with gcj you have a bunch of
libraries in DSOs.  Same thing, more or less: the DSOs are
precompiled, the .jar files aren't.

I only provide statically compiled GCJs. So you have to look at the FAQ in that context... Already the question "Why are the binaries so big? With GCJ X.Y.Z, they were way smaller..." is completely useless in the shared mode context...



Marco



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