®
IBM Software Group
What's the Difference Between
32 and 64 Bit Java?
Andrew Hall
IBM Java Technology Center
WebSphere® Support Technical Exchange
IBM Software Group
Objectives
To understand the difference between 32
and 64 bit Java™ runtimes
To understand the native memory
limitations of the 32 bit Java runtime on
AIX®, Windows® and Linux®
To understand the reduced performance of
64 bit Java runtimes compared to 32 bit
WebSphere® Support Technical Exchange
2
IBM Software Group
Outline
What do we mean by 32 and 64 bit?
Address Spaces and Native Memory
32 bit Address Spaces: Windows, Linux
and AIX
64 Bit Address Spaces
Performance of 64 Bit Java Runtimes
Considerations for Application Scaling
WebSphere® Support Technical Exchange
3
IBM Software Group
What do we mean by 32 or 64 bit?
"X Bits" refers to the width of the general-purpose processor
registers
Defines the largest integer that can we used in a single
calculation
Defines the size of memory addresses
Defines the range of memory that can be addressed
32 bit = 4 GiB (largest address is 0xFFFFFFFF)
64 bit = 16 EiB (largest address is 0xFFFFFFFFFFFFFFFF)
390 is an exception - 32 bit registers, 31 bit address bus
WebSphere® Support Technical Exchange
4
IBM Software Group
32 Bit
WebSphere® Support Technical Exchange
5
IBM Software Group
Native Address Spaces
The address size defines the address space - the
region of addressable memory
We refer to "native" when talking about operating
system rather than Java resources
Each OS process has a virtual address space
Each process must be able to reference kernel
memory (kernel space) and program data (user
space)
Programs (such as Java) must fit all of their data
within user space
WebSphere® Support Technical Exchange
6
IBM Software Group
What does Java use native memory for?
Java heap
Allocated as a contiguous chunk
Occupies the -Xmx value from startup
Threads
Just In Time (JIT) Compiler
Runtime data
Storing executable code
Classes and ClassLoaders
JNI
Native malloc/new in JNI functions
Used by the interface itself
Direct java.nio.ByteBuffers
Java runtime data
WebSphere® Support Technical Exchange
Kernel Space
Java Heap
User
Space
JIT data
Thread Stacks
Native
Allocations
Libraries
7
IBM Software Group
Native Memory on Windows 32 Bit
0x00000000
0x7FFFFFFF
< 2 GiB
2 GiB User Space
WebSphere® Support Technical Exchange
Libraries
Java-usable area
0xFFFFFFFF
2 GiB Kernel Space
8
IBM Software Group
Native Memory on Windows with the
/3GB Switch
0x00000000
0xBFFFFFFF
< 3 GiB
Libraries
Java-usable area
3 GiB User Space
WebSphere® Support Technical Exchange
0xFFFFFFFF
1 GiB
Kernel Space
9
IBM Software Group
Native Memory on Linux 32 Bit
0x00000000
0xBFFFFFFF
0xFFFFFFFF
Java-usable area
< 3 GiB
3 GiB User Space
WebSphere® Support Technical Exchange
1 GiB
Kernel Space
10
IBM Software Group
Native Memory on Linux with Hugemem Kernel
0x00000000
0xFFFFFFFF
Java-usable area
< 4 GB
0x00000000
4 GiB User Space
0xFFFFFFFF
4 GiB Kernel Space
WebSphere® Support Technical Exchange
11
IBM Software Group
Native Memory on 32 bit AIX
0x00000000
0xFFFFFFFF
Shared Lib Data
Shared/Mapped
Shared Lib Text
Stack + Data
App. Text
Kernel
Shared / Mapped storage
0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF
WebSphere® Support Technical Exchange
12
IBM Software Group
Native Memory on AIX - Java Usable Storage
Lib Data
Lib Txt
Stack
App. Text
Kernel
Java Usable Area < 2.75 GB
-mx < 2304
0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF
Stack
App. Text
Kernel
Java Usable Area < 3.25 GB
-mx > 2304
0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF
Native Heap
App. Text
Kernel
Java Heap
-mx > 3072
0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF
WebSphere® Support Technical Exchange
13
IBM Software Group
64 Bit Java Runtimes
WebSphere® Support Technical Exchange
14
IBM Software Group
64 Bit User Space
Platform
User Space
Windows AMD64
8192 GiB
Windows Itanium
7152 GiB
Linux AMD64
500 GiB
Linux PPC64
1648 GiB
Linux 390 64
8 EiB
AIX PPC64
448 PiB
WebSphere® Support Technical Exchange
15
IBM Software Group
64 Bit Java
64 bit Java allows massive Java heaps
At Java 5, 64 bit can be around 20% slower than
corresponding 32 bit runtime
Larger objects occupy more space and reduce
memory system efficiency
Higher heap consumption reduces GC
performance
We assume a ~20-30% increase in object size /
heap consumption - but can be much larger
WebSphere® Support Technical Exchange
16
IBM Software Group
64 Bit Objects
public class Customer{
private Date dateOfJoining;
private String name;
private int numberOfOrders;
private int shoeSize;
}
Size/Bits
32
0
Header
Header
64
dateOfJoining
96
name
dateOfJoining
128
numberOfOrders
name
160
shoeSize
192
224
32 Bit Object
numberOfOrders
shoeSize
64 Bit Object
WebSphere® Support Technical Exchange
17
IBM Software Group
WAS and 64-bit memory growth
WAS 64-bit Memory growth% for T rade6
100
90
80
70
60
50
40
30
20
10
0
Power64
x64
64 bit Java significantly increases memory footprint
– POWER yields 60% memory growth for Trade6 on WAS 6.1
– x86-64 yields 70% for Trade6 on WAS 6.1
Trade 6 is a J2EE™ Benchmark Based Around Stock Trading
WebSphere® Support Technical Exchange
18
IBM Software Group
Garbage Collection on 64 Bit
Java Heap
Java Heap
Java Heap
Used
Used
App on 64 bit
Same -Xmx
App on 64 bit
-Xmx increased to
maintain usage %
Used
App on 32 bit
WebSphere® Support Technical Exchange
19
IBM Software Group
64-bit WAS Performance
WebSphere
20
®
Support Technical Exchange
20
IBM Software Group
Deployment Design Considerations
64 bit is the only option if you need to hold large
quantities of data in memory at the same time
When considering application scaling, there are
two choices:
Monolithic scaling with a small number of 64 bit
JVMs (scaling up)
"Hotelling" with many clustered 32 bit JVMs
(scaling out)
WebSphere® Support Technical Exchange
21
IBM Software Group
Future Improvements
IBM® Java 6 (shipped with WebSphere
Application Server 7) contains massive 64
bit performance improvements
Compressed references removes object
bloat (32 bit objects in a 64 bit address
space)
Conventional performance analysis and
improvement has also been applied
WebSphere® Support Technical Exchange
22
IBM Software Group
Summary
32 bit runtimes are faster than 64 bit, but are
limited to 1.5-3GiB heaps
64 bit runtimes allow massive heaps
Significantly slower
Use more physical memory
Currently we recommend 32 bit for most scenarios
(at Java 1.4.2/Java 5)
64 bit performance much improved at Java 6
WebSphere® Support Technical Exchange
23
IBM Software Group
Additional WebSphere Product Resources
Discover the latest trends in WebSphere Technology and implementation, participate in
technically-focused briefings, webcasts and podcasts at:
http://www.ibm.com/developerworks/websphere/community/
Learn about other upcoming webcasts, conferences and events:
http://www.ibm.com/software/websphere/events_1.html
Join the Global WebSphere User Group Community: http://www.websphere.org
Access key product show-me demos and tutorials by visiting IBM Education Assistant:
http://www.ibm.com/software/info/education/assistant
View a Flash replay with step-by-step instructions for using the Electronic Service
Request (ESR) tool for submitting problems electronically:
http://www.ibm.com/software/websphere/support/d2w.html
Sign up to receive weekly technical My support emails:
http://www.ibm.com/software/support/einfo.html
WebSphere® Support Technical Exchange
24
IBM Software Group
Questions and Answers
WebSphere® Support Technical Exchange
25
© Copyright 2026 Paperzz