public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* gcj compilation size.
@ 2009-08-03 11:14 abhishek desai
  2009-08-03 11:26 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: abhishek desai @ 2009-08-03 11:14 UTC (permalink / raw)
  To: java

Hi

I have a simple HelloWorld.java file which prints data to screen.

When compiled to a .class file the size is 469 bytes. When the same
file when compiled to an object file, the size is 1420 bytes. The
difference is much bigger if there are lots of java files. Can anyone
please explain why there is such a big difference between the two
sizes and is there a way to reduce the size of the compiled object
file ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcj compilation size.
  2009-08-03 11:14 gcj compilation size abhishek desai
@ 2009-08-03 11:26 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2009-08-03 11:26 UTC (permalink / raw)
  To: abhishek desai; +Cc: java

abhishek desai wrote:

> I have a simple HelloWorld.java file which prints data to screen.
> 
> When compiled to a .class file the size is 469 bytes. When the same
> file when compiled to an object file, the size is 1420 bytes. The
> difference is much bigger if there are lots of java files. Can anyone
> please explain why there is such a big difference between the two
> sizes

Java bytecode is very compact.  You can see why by reading the Java VM
specification.

> and is there a way to reduce the size of the compiled object
> file ?

Sometimes strip can help.

Andrew.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-03 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 11:14 gcj compilation size abhishek desai
2009-08-03 11:26 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).