Difference Between 32-bit Java and 64-bit Java
32-bit Architecture :In any 32-bit operating system, 4096 MB of RAM is available. So, theoretically speaking we can allocate 4 GB of memory per process.Now let's see how process address space is handled in Windows (Operating System). Windows divides the process address space in half. First half is reserved for usage of operating system i.e. user processes cannot use this space and the other half is for user processes.In addition to this the address space allocated to user processes has to be contiguous, so practically we are left with 1.6 - 1.8 GB of heap on Windows.BIOS and other device chips in mother board like video card also occupies some memory from that 4 GB space so actual memory available for usage will be around 1.5 GB.
64-bit Architecture :We know that 32 bit system can access only 4 GB of RAM, whereas 64-bit can access 17.2 Billion GB of system memory, again this is theoretically. So one might think that, 64-bit will solve all the memory consumption problems from system, but it doesn't work that way.Windows 64-bit Home editions are still limited to 16 GB of RAM whereas Professional and Ultimate versions can use up to 192 GB of RAM due to compatibility issues.One more advantageous thing about 64-bit is that per process limit is increased, each application can access upto 8 TB of virtual memory.
Versions of java on 32-bit/64-bit machines :On a 32-bit machine, we have to install 32-bit java/JRE. On 64-bit machine, we can choose between 32-bit java and 64-bit java both will work fine here.Now let's talk about problems.High availability of memory has its own problems at runtime.1. 64-bit requires 30-50% more heap than 32-bit. The reason is memory layout of 64-bit architecture. In 32-bit JVM object headers are of 8 bytes and references are of 4 bytes, whereas in 64-bit headers are of 12 bytes and references can be of 4 to 8 bytes.2. More the heap more work is for Garbage Collector, cleaning unused objects. One has to be extra cautious while building heaps larger than 14-18 GB. It can easily turn into full GC pauses spanning several minutes.