What are the differences between 32-bit and 64-bit, and which should I choose?
I believe the main question when choosing between 32 and 64 bits is not "Does my processor support 64 bits — if so then I should use 64 because that's twice as good", but "How much memory do I have?".
64-bit programs use about 50% more memory then their 32-bit counterparts. The results of this are:
less code/data can fit into processor caches -> more cache misses -> your super-fast processor waits more for memory controller to fetch data from RAM. Processor also needs to read more data because it's more bloated.
Linux uses non-allocated RAM to cache disks. Less free memory available -> less space for disk caches -> slower disk access
Once you're out of RAM and the system starts swapping - disk access is thousands times slower than RAM, so any potential benefits of 64-bit code (see below) are flying out of window.
On the other hand, in 64-bit mode processor has more registers, so it doesn't need to access memory that often, also, some calculations (64-bit numbers etc.) are more efficient. So generally, code which is not memory-restricted runs slightly faster in 64-bit mode.
So, if your system has, say, 2GiB of RAM or less then I would definitely choose 32 bits. More than 4GiB - the benefits of 64 bits are becoming more prominent. Around 4GiB is a "grey zone" - you need to make a choice yourself.
Here are screenshots of a (rather old) vanilla Ubuntu running in a VirtualBox with 1GiB RAM:
32 bit: uses 388 MiB of RAM right after booting, no additional applications running (from the screenshot, 397780KiB, which is 388MiB)
64 bit: uses 491 MiB of RAM (from the screenshot, 503452KiB = 491MiB)
Additionally, in my testing, a web-application written in Python used up to 60% more memory on a 64-bit machine which resulted in a test suite running in 380 secs on a 32-bit machine but taking 523 seconds on a 64-bit one (both with 1GiB of RAM). If the machines were not RAM-limited the results would likely be different (as phoronix tests show).
Here are some more thorough and recent tests: http://kernel.ubuntu.com/~cking/x32/Quantal-x32-power-memory-comparisons.ods
Basically, it's like giving up 30% of your RAM in exchange of possible gain of 10% CPU speed.
If you don't care to learn the technical details, select the recommended 32-bit version.
64-bit is generally faster, even if objectively hard to notice. This is has less to do with the 64-bit data width, but with the availability of 16 over 8 common CPU registers on the whole instruction set. The disadvantage of wasting more memory for management and larger pointers is thereby mostly levelled out.
The practical problem: not everyone has a AMD64 compatible CPU. Promoting 64-bit over the standard i686 version would lead to more user frustration. Therefore for the next few years, it's less confusing to present the 32-bit version to the average user. It's not exactly a problem for anyone in the know, since the 64-bit version is readily available. And we amd64 users don't have any disadvantage from that situation, except for the initial download. All packages are available in both architectures.
Under the circumstances the Ubuntu download page looks okay to me. It says "32 bit (recommended)", but that "recommended" translates to "fewer issues, if you don't know all the technical details of your computer". For the netbook edition download page, there isn't even the choice, because some Intel atom CPUs are 32-bit only even in 2010!
So in conclusion, I think eschewing the compatibility problems is still necessary. However, I agree that there should be at least a shiny footnote along the lines that -64 is faster than -32, and recommended IF (BUT ONLY IF) the target system supports it.
The terms 32-bit and 64-bit refer to the way a computer's CPU handles information. The 64-bit version handles large amounts of RAM more effectively than a 32-bit system. 1
- To run a 64-bit OS you need support from the 64-bit CPU.
- To run a 64-bit application you need support from both the 64-bit OS and the 64-bit CPU.
The general rule is that 32-bit (OS and Application) will run on 64-bit, but 64-bit (OS and Application) does not run on 32-bit:
- A 32-bit OS will run on a 32-bit or 64-bit processor without any problem.
- A 32-bit application will run on a 32-bit or 64-bit OS without any problem.
- But a 64-bit application will only run on a 64-bit OS and a 64-bit OS will only run on a 64-bit processor.
A 64-bit compatible CPU is needed to install a 64-bit OS. Check with the manufacturer of your PC to find out if your system is 64-bit compatible.
32-bit systems have a 4 Gigabyte RAM memory limit, which means they cannot address more than 4GB of RAM even if more is installed on the system (Not all of it will be used). Workarounds are available, but hard to do for an average user.
Note: Ubuntu 12.10, and newer will support PAE automatically. Prior to 12.10, you have the option to choose PAE support depending on your CPU. PAE extends maximum RAM on 32-bit to 64GB, more inforamtion can be found here.
64-bit editions have additional advantages, including an increased bandwidth, hardware enabled DEP (data execution prevention) and better Kernel protection.
The majority of 32-bit applications will continue to work on a 64-bit systems, but some applications do not work at all, or will run slower.
For more information you can look at 32-bit and 64-bit