Debian – Running 64-bit Linux with 750 MB of RAM: worth it

32bit64bitdebian

I have a Debian server VPS, and the provider installed 64-bit Debian 5. Should I ask for an 32-bit install, given that I have only 750 MB RAM and I have heard that variables take more RAM on 64-bit systems?

Best Answer

The short answer:

Variables do not take double the space in 64-bit vs 32-bit software. The potential memory gain from switching to a 32-bit OS will not be worth the effort.

The long answer:

Numbers can be larger yes, but that doesn't mean they will be. Also this applies to numbers, not strings, and strings are (generally) what consume the most amount of memory in an application.

Additionally, many applications explicitly specify the size of the number they want to work with, as in languages like C, int can be any size, including smaller than 32-bit. And going even further, on my 64-bit Linux machine, in C int is 32-bit. So you would have to explicitly request long long to get a 64-bit number.

So basically, applications aren't going to use more memory just because they were compiled for 64-bit.

EDIT:
In response to Gilles' claim that 64-bit Firefox uses twice as much memory, I went and did a comparison between 32-bit and 64-bit Firefox on my system.
I tested by launching 5 tabs open to http://acid3.acidtests.org/ and performed the test 3 times (once in 32-bit, once in 64-bit, and then repeat twice). I chose this site because it's JavaScript intensive, and uses static content (each rendering of the page will provide the same data).

On the final run:

  • 32-bit: 173,244kb rss / 918,348kb virt

  • 64-bit: 184,588kb rss / 966,624kb virt

I could do more extensive testing yes, but I think this demonstrates well enough that the size difference between the two is marginal.

Related Question