144

What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.

If so, why not promote 64-bit over 32-bit?

Braiam
  • 67,791
  • 32
  • 179
  • 269
squallbayu
  • 3,054

17 Answers17

151

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)

32 bit Ubuntu

64 bit: uses 491 MiB of RAM (from the screenshot, 503452KiB = 491MiB)

64 bit Ubuntu

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

mem free mem used swap used

Basically, it's like giving up 30% of your RAM in exchange of possible gain of 10% CPU speed.

jdthood
  • 12,467
Sergey
  • 43,665
  • 1
    So 32-bit, 388M; 64-bit, 498M or about 110M more and that's 30% of 2G?? – irrational John Apr 23 '12 at 00:52
  • No, those numbers are for just the operating system, no applications running. If you start, say, Firefox and a few others - at some point they'll use, say, 2G on a 64-bit system but only 1.4G on a 32-bit one. Guess which one will be faster then :) – Sergey Apr 23 '12 at 00:58
  • 22
    I'd agree with the numbers but disagree with the conclusion. 30% less RAM for 10% improved performance makes it the deal of the century! What's more, it's a lot cheaper to chuck in extra RAM than it is to replace the CPU. – Oli Aug 28 '12 at 10:49
  • @Oli: do I detect irony? :) My point is - on a memory-limited system having 30% "more" RAM is more important than having a 10% "faster" CPU, especially when RAM usage grows to the point where the system starts swapping. Adding more RAM is, of course, an ultimate solution. And a fast SSD too :) But in a situation where an upgrade is not an option and RAM is limited, I would choose a 32-bit system. – Sergey Aug 28 '12 at 10:56
  • There are so few situations where that's the case those. Embedded systems and and handful of laptops are the only systems where you shouldn't consider 64bit (and the RAM upgrade, if you need it). – Oli Aug 28 '12 at 13:25
  • @Oli: I explicitly state in the answer that 32 bit is only better for systems with 2Gb of RAM and below, for a beefy desktop machine 30% less RAM for 10% boost in performance is in fact the deal of the century. I do use 64 bit Ubuntu on my beefy desktops, but unfortunately my laptops are puny and pitiful, and they run 32-bit OSes. Horses for courses. – Sergey Sep 08 '12 at 10:31
  • 1
    Yeah I don't disagree with that but I would put it stronger and go slightly further, only suggesting 32bit when it's not supported by the CPU or it's not viable to upgrade the RAM (it's ancient or you're about to throw it away). People with a modernish computer with <=2GB should spend the $20-30 on ebay and have 4GB. A 10% boost is worth that. – Oli Sep 08 '12 at 13:49
  • If 32-bit is recommended, then why does Wubi prefer 64-bit? – Dan Dascalescu Dec 30 '12 at 02:45
  • @DanDascalescu: In my answer I tried to point out that in low-RAM situations 32 bit may offer better performance than 64 bit, even if processor supports 64 bit. It does not mean 32-bit is always preferred - in fact, most computers sold in the last few years have enough RAM to make 64-bit OS preferable on "normal" consumer machines. However, there's still a large proportion of systems (low-end laptops and especially shared hosting machines) which are RAM-limited, for which 32 bit makes more sense. – Sergey Dec 30 '12 at 10:54
  • Related, now that 64-bit is the default and some people need 32-bit instead: How to select the architecture to download? – Eliah Kagan Jan 11 '14 at 13:25
  • 1
    I'm curious how modern browsers with lots of open tabs and javascript fare here. I often run into swap (even with 8 GB RAM) by opening up lots of tabs, and modern web sites use lots of javascript libraries etc. How do the memory and cpu speed compare for heavy chrome or firefox usage? – nealmcb Mar 04 '14 at 17:57
  • @nealmcb: In the charts above you can see LibreOffice + Firefox combo, and it follows the general trend of 64-bit code using more memory. Once the system starts swapping any difference in CPU speed is not really relevant I believe. In case of a 8Gb system a 64-bit OS is definitely a better choice though. – Sergey Mar 04 '14 at 23:38
  • @Sergey But I'm pointing out that even with 8 GB, I typically have some swap due to tons of browser tabs. And in both cases in your charts with Firefox, there is swapping (in 1 GB), so I can't learn much there. If I could get, say, 50 of my typical browser tabs without swapping using 32-bit, while I'd start to swap at 40 browser tabs with 64-bit (I'm making the numbers up of course), then 32-bit starts looking nice. But I don't know if the 30% vs 10% rule applies to javascript/web pages/threads in modern browsers. – nealmcb Mar 05 '14 at 04:04
  • 1
    @nealmcb: You're limited to ~3Gb of RAM per process in 32-bit mode, even with PAE and everything. So it won't help you with Firefox (although it might help with Chrome because it is using a separate process for each tab). – Sergey Mar 05 '14 at 04:35
  • 2
    Is this still true in 2015? I want to install Ubuntu 14.04 on an Atom tablet that has 1GB of memory and a slow CPU (64-bit capable), thus after reading this I strongly tend towards 32-bit. Has anything worth considering changed since posting this answer? Especially in terms of 64-bit's base memory consumption compared 32-bit's, since memory would be the greatest bottleneck on this system. – Andreas Hartmann Feb 13 '15 at 08:13
  • 1
    @AndreasHartmann: a 64-bit integer or a memory address does take twice as much space as a 32-bit one, that's kind of a law of physics and is unlikely to change... But you're very welcome to download two ISOs, a 32-bit one and a 64-bit one, boot from each one on your target device and have a look yourself. I'd be curious to know the results. – Sergey Feb 13 '15 at 14:06
  • I would do that, if installing Ubuntu on that particular device weren't so ridiculously difficult. I guess I'll be going with 32bit then. – Andreas Hartmann Feb 13 '15 at 17:58
  • interesting. the most resource intensive task i run is virtual box itself... on a 8gb ram box. i might take some measurements of perf running 32 hosts machines and report back. vbox code is very optimized for cpu types. i'd be surprised if it doesn't abuse extra registers for perf... – gcb Sep 06 '15 at 21:18
  • actually on x86_64 there will be less cache misses than on x86, because the larger register space makes spilling less necessary. I've seen benchmarks on this but can't find this right now – phuclv Nov 17 '16 at 12:58
22

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.

Jjed
  • 13,874
mario
  • 3,460
18

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

1Source: Microsoft

Mitch
  • 107,631
  • @Alvar The CPU has to support PAE. In general, a proper 64 bit system is recommended if you have 4 Gb or more memory and/or want to get the full benefit of the 64 bit architecture. – Mitch May 27 '13 at 16:12
  • I understand, but as I said the CPU has to support PAE for it to work. For example Atom dosen't support PAE. – Mitch May 27 '13 at 16:29
  • Just added that as a note in the answer. – Mitch May 27 '13 at 16:32
  • added an explanation of what PAE is with source. Hope you are happy with it. – Alvar May 27 '13 at 16:36
10

As pointed here in Phoronix: "With the Ubuntu multi-arch situation being cleared up, most applications and plug-ins now working fine on 64-bit (such as Adobe Flash and Java), and 64-bit being usually much faster than 32-bit, there really is no big reason not to move to the x86_64 version."

Although it is discussed if 64bit will be indicated as the default instead of 32bit, I think you have some performance gain with the first. See these benchmarks.

And a word of your "low" RAM memory from Phoronix: "[S]ome Ubuntu developers have been overly concerned about 32-bit netbooks being out there still and for systems that only have 2GB of RAM where using x86_64 software may lead to running low on memory and thus increased SWAP usage. However, for a far majority of users, they're much better off in a 64-bit world."

Maybe you can install it and watch if the system uses the swap often.

desgua
  • 32,917
3

I looked into this for Ubuntu Precise LTS a while back. Here are some results of some analysis I ran:

http://kernel.ubuntu.com/~cking/power-benchmarking/blueprint-foundations-p-64bit-by-default/low-memory-systems/readme.txt

http://kernel.ubuntu.com/~cking/power-benchmarking/blueprint-foundations-p-64bit-by-default/hpmini-and-x220-tests/results-3/results.txt

Basically, if you have 4GB or less is OK, for more than 4GB consider using i386-pae or amd64. 64 bit systems consume more memory (for example, pointers are 64 bit in size) but you may see a performance win on 64 bit systems because of optimisations that use 64 bit copies or use the extra CPU registers that are available in 64 bit mode.

3

For me the most important was the fact that You can not use ZFS filesystem on 32bit os, because it is simply unstable there due to vmalloc limits of 32bit os (regardless of PAE or nonPAE). That was a reason for me to reinstall to 64bit, and I never looked back. Even NVIDIA has few lines about vmalloc thing in "troubleshooting" pages, ending by encouraging users to switch to 64bit kernels.

There is an adressing limit of 1GB in 32bit mode, so even if it can use up to 4GB, only 1GB is so called "low" and the rest is "high memory" which is not that general. And 1GB is really small number, nowadays.. Try #free -l

coro
  • 61
  • 1
  • 11
2

For plain user experience official Ubuntu site suggests 32-bit versions due to more flexible tuning.
I count here also means the data consistence.

There are exists a very many points for any pro and contra. My view is a great performance of 64-bit OS on Intel Architecture 64-bit processor directly related to using 64-bit software and drivers, that can give you the chance to beat regular 32-bit performance.

Note that using of 32-bit software on 64-bit OS sometimes can cause a bad performance and even overheating in very different cases.

However, by your signed components and this reference:
Intel® Extended Memory 64 Technology: 64-Bit Desktop Computing
... better experience possible with 4Gb+ of memory.

I count this will good and not very expensive solution for you.

And yeah, using both systems in parallel able to bring you more clear understanding your configuration and versatility in the meanings.

swift
  • 3,281
  • 2
  • 23
  • 46
2

Basically I would say use 64 bit version if you need it.

If you are mainly browsing the web, watching youtube, hang around on facebook, watch films etc. then 32 bit is better because you don't need any good hardware to do those things.

If you play games on Steam, WINE etc., run loads of programs, do some media editing and such then 64 bit is best choice.

so casual use then 32 bit OS, Advanced use then 64 bit version.

user241367
  • 31
  • 1
2

As stated by previous posters, 64-bit vs 32-bit refers to the size of data which can be moved in one operation by the computer. This relates to the size of the registers on the CPU and the width of the busses (a register is just holds data for the CPU to operate on, they used to be tiny in consumer hardware and have been growing since the inception of home computing. Busses connect different parts of a motherboard together, they are the highway on which the data flows around).

The issue is that most OSes had some real issues when moving over to 64-bit operations, with poor support for drivers and applications. Often applications actually had worse performance in early versions. Given that there is no real reason for most people to jump in the deep end, the Linux powers-that-be seem to be taking the move a little slower than cough _other_ OSes, slow but steady.

Jeremy
  • 2,846
1

Like squallbayu I was hoping the 64 bit would work better since I had just purchased a 17" Macbook Pro intel i-7 8 Gig RAM 500 Gig hard drive latest Lion OS in the spring of 2011. Unfortunately after installing both 64 first and then 32 bit hands down the 32 bit was more stable and smooth.. I didnt knotice anything to do with speed (minimal difference) As I am not an expert but I really think that the benefit of 64-bit will not be noticed until software developers learn how to harness its power..

Pete
  • 11
  • 1
1

Apart from the differences excellently stated by the other community members, if you are concerned about RAM, you can always install zRAM.

Wikipedia info on zRAM:

zRam is an experimental (staging) module of the Linux kernel. It was previously called "compcache". zRam increases performance by avoiding paging on disk and instead uses a compressed block device in RAM in which paging takes place until it is necessary to use the swap space on the hard disk drive. Since using RAM is faster than using disks, zRam allows Linux to make more use of RAM when swapping/paging is required, especially on older computers with less RAM installed.

Even though the cost of RAM hardware is relatively low this feature still offers advantages for netbooks and other lower-powered laptops, virtualization and in the case of embedded devices, especially those that use flash memories that have a limited lifespan, dependent on write-use and thus wear out quickly when used as a swap device.

Halta
  • 669
1

The difference between 32 bit and 64 bit has not changed since this question was posed.

I would suggest to use the 64 bit version.
I don't know a software which can't be used on an 64 bit system and if you want to use 4 GB (or more) of RAM you need to use the 64 bit version of ubuntu.

fossfreedom
  • 172,746
prophecy201
  • 2,690
  • 16
  • 21
  • I only have 4GB of RAM, still is it better to go with 64 bit version? The answers to that question were way too technical for me to understand. Thanks – Cool_Coder Apr 11 '13 at 10:15
  • 1
    Use the 64 bit edition. I dont think that you will have problems with that. I'm using 64 bit with all of my machines and there is no problem. – prophecy201 Apr 11 '13 at 10:17
  • ok thanks for that information. I will install the 64 bit version. – Cool_Coder Apr 11 '13 at 10:22
  • @Cool_Coder, the only reason you should consider the 32 bit version is if you work for a company that uses Juniper Networks Connect, a web/Java based VPN system that only works with 32 bit Java. To be sure, 32 bit Java can be installed in 64 bit Ubuntu, but I find doing that a bit of a pain. Other than this, I know of no other reason for favoring 32 bit Ubuntu on a 4GB machine. – user68186 Apr 11 '13 at 13:39
1

32-bit and 64-bit refer to the size (or width) of a chunk of memory or more accurately, the memory registers in a computer's CPU - this defines how much data the processor can handle in a single operation. 32-bit and 64-bit refer to the size (or width) of a chunk of memory or more accurately, the memory registers in a computer's CPU - this defines how much data the processor can handle in a single operation. Yes, that means that the 64-bit version is going to operate faster since it can handle more data at one.

1

To be honest, I haven't perceived any difference except from slightly reduced time required to compile programs and to encode video. Other than that, it feels the same to me. I have noticed tho, that what really makes a difference in terms of performance is the video driver. I guess the 32bit video drivers are better supported. I recently installed the latest nVidia 260 driver on a 32bit system and it made a LOT of difference. I'm currently using 32bit.

lovinglinux
  • 6,367
1

I use Ub64 in a AMD64 chip, I can feel the speed diference. It's not a big boost, but you can feel. Why won't you give a try for 10 secs to each one, and compare by yourself, on your own system (which is the point of the question)? I'm sure you will be not losing your time, since installation is so fast this days. (tks Ubuntu!-)

The Java/Flash issues have "good" workarounds around the net too...

H_7
  • 661
1

Personally on my desktop I'm running 64 bit because it supports more then 4gb of ram. You also get a speed boost. I know that you can also optimize 32 bit to be able to detect 4gb of ram or more. About your second question 32bit is name i386 because intel was the ones that deveolop the 32bit instruction/technology and AMD follow. AMD then develop the 64 bit and then Intel catch up or adopted that technology. That's why 64bit is Amd64.

jart
  • 393
0

Apart from being able to address more memory and possible speed improvements, you should download and install the 64-Bit version for your new UEFI capable machine that comes with Windows 8 or a newer version of Windows.

While 32-Bit support for UEFI systems is being worked on, there are currently no standard 32-Bit images available that boot in UEFI mode.

LiveWireBT
  • 28,763