Do java classes need to be recompiled for 64 bit O/S
sunil choudhary
Ranch Hand
Joined: Nov 10, 2000
Posts: 138
posted
0
We usaually see that we have a seperate Software for 32 bit and 64 bit O/S Also people say that 64 bit machines can run most of 32 bit software albeit performance increase is not guaranteed.
My search into hte ranch gave me one nugget that is ---------- "By default jvm runs in 32 bit mode. I think you have to pass an argument ( -d64 ) into the JVM to make it run in 64 bit mode. " (Thanks Rich) -----
My question is if we need to recompile our java classes and jar files (and regenerating this byte code) to get them to work efficiently. Or it is not required as it is the jvm which is handling the execution.
thanks for inputs. Sunil
----------------------------------<br />"Learning is weightless, a treasure you can always carry easily."<br />-Chinese Proverb
Nope, you don't need to recompile. 64-bits doesn't mean the code runs more efficiently, it has to do with the maximum amount of memory that can be allocated by a program, and this is completely controlled by the JVM.
The compiled code isn't compiled for a specific machine or processor, the JVM will take the java compiled code and interpret it properly into real machine code whether the system is 32 bit or 64 bit. Although, for a program to actually require 64-bit addressing it would have to have access and use more than 4 GBs of space, which is very unlikely unless you are running a server. [ November 16, 2005: Message edited by: Scott Selikoff ]
The Java code will take advantage of the 64 bit architecture if you've got a 64-bit JVM running in 64-bit mode.
Note that Sun's 32-bit JVMs actually have a Java heap limit of about 1855 MB, so anything above that (a limit I've bumped into a number of times in scientific computing applications) and you will benefit from a 64-bit heap.
Among other things, I support a single Java application (no recompiling) for many architectures, including a few 64-bit architectures. Therefore, there is no need to recompile (in fact, it is impossible since it is ill-defined).