wood burning stoves 2.0*
The moose likes Java in General and the fly likes Diffrence between code complied on 32, 64 bit JDK? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Diffrence between code complied on 32, 64 bit JDK?" Watch "Diffrence between code complied on 32, 64 bit JDK?" New topic
Author

Diffrence between code complied on 32, 64 bit JDK?

anna anhc
Greenhorn

Joined: Jun 09, 2010
Posts: 1
Hi,

Just wanted to know if there will be any difference in terms of performance between code complied on 32, 64 bit JDK, while running on 32, 64 bit JDK?

Therotically there should not be any difference , but the .class files are in binary format and are created using specific jdk's. Thus there might be difference according to which JDK is used for compiling them.

Is there any documentation from sun/ oracle which confirms that there is no difference/ there is a difference?





Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

The space an object takes in the heap in 64-bit mode is 39.3% larger on average than in 32-bit mode. You may find more information here

Life is easy because we write the source code.....
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18990
    
  40

anna anhc wrote:
Therotically there should not be any difference , but the .class files are in binary format and are created using specific jdk's. Thus there might be difference according to which JDK is used for compiling them.


There are *no* class files differences between code compiled with the 32 bit and 64 bit versions of the same revision of Java. The class files should be the same.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39851
    
  28
Pramod P Deore wrote: . . . You may find more information here
They used Jikes and an IBM JVM for jdk1.4; things might have changed since then, and the Sun JVM might behave differently.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18990
    
  40

Pramod P Deore wrote:The space an object takes in the heap in 64-bit mode is 39.3% larger on average than in 32-bit mode.


Having "ported" a lot of applications from a 32 bit environment to a 64 bit environment, I can say that I have never seen an increase of the memory footprint, average or otherwise, as large as 40 percent. Larger? yes. Forty percent larger? no.

Henry
Jayavardhan geepi
Ranch Hand

Joined: Jul 21, 2010
Posts: 66
Can some one please explain the difference between 32 bit jdk and 64 bit jdk?

Jay
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1510
    
    5

Jayavardhan geepi wrote:Can some one please explain the difference between 32 bit jdk and 64 bit jdk?

Jay

Well, 32 bit jdk is meant to run on 32 bit platform, whereas 64 bit jdk is meant to run on 64 bit platform. However, class file is exactly same, not matter on which type of Oracle jdk it is compiled (i.e. class file created by 32 bit jdk on Windows is same as that created by 64 bit jdk on Linux)

I hope this helps.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
 
 
subject: Diffrence between code complied on 32, 64 bit JDK?