Skip to main content

Which is fastest ? 32 or 64 bits JVM and Linux ?

2 replies [Last post]
beardb
Offline
Joined: 2004-12-01
Points: 0

On a new app, we need to choose the following two options:
- 32 or 64bits JVM (plus vendor)
- 32 or 64bits Linux RHEL4 on quad dual core opteron 2.4GHz

so options are:
1) 32bits JVM + OS
2) 32bits JVM + 64bits OS
3) 64bits JVM + 64bits OS

I've heard so far that 32bits JVM are still faster, but unclear what will be the effect of using 32 or 64 bits OS ?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tmarble
Offline
Joined: 2003-08-22
Points: 0

This happens to be a common question...

Realize that the 64-bit JVM is not magic pixie dust that makes Java apps
go faster. The 64-bit JVM allows heaps >> 4 GB and, as such, only makes sense
for applications which can take advantage of huge memory on systems which
have it.

Generally there is either a slight improvement (due to certain hardware
optimizations on certain platforms) or minor degradation (due to increased
pointer size). Generally speaking there will be a need for fewer GC's -- but
when they do occur they will likely be longer. Your targeted
platform (AMD Opteron) has additional registers that Sun's
HotSpot JVM can take advantage of. (Advertisement that helps
keep the lights on: Sun sells AMD hardware: http://www.sun.com/x64/ )

In memory databases or search engines that can use the increased memory
for caching objects and thus avoid IPC or disk accesses will see the biggest
application level improvements. In addition a 64-bit JVM will also
allow you to run many, many more threads than a 32-bit one, because
there's more address space for things like thread stacks, etc. The
maximum number of threads generally for a 32-bit JVM is ~1000.
We've run ~100000 threads with a 64-bit JVM.

Additional issues with the 64-bit JVM are that certain client
oriented features like Java Plug-in and Java Web Start
are not supported. Also any native code would also need
to be compatible (e.g. JNI for things like Type II JDBC drivers).
This is a bonus for pure-Java developers as pure apps should
just run out of the box.

So I would recommend running the 64-bit OS if and only if
you plan to have more than 4 GB of physical RAM. Then you
can try either the 32-bit or 64-bit JVM for your application
to see which is better for you.

Supported System Configurations for J2SE 5.0
http://java.sun.com/j2se/1.5.0/system-configurations.html

Remember to get the latest update release
http://java.sun.com/performance/reference/whitepapers/tuning.html#section2

Java support for Large Memory Pages
http://java.sun.com/docs/hotspot/VMOptions.html#largepages

HTH,

--Tom

alexlamsl
Offline
Joined: 2004-09-02
Points: 0

I'd go with the 64-bit OS; as for the JVM the only thing I'm certain is that 64-bit ones have higher memory overhead cost per Object.

Performance-wise I have yet to see comparisons on the 2.