Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Given that today (for performance reasons?) variables are usually aligned to the "bit-width" (I wanted to use "word-width" here, but on x86 a "word" is still 16 bits right?) of the processor, would switching from a 32 bit OS to its 64 bit version double the RAM usage?

Would this then in turn mean that to do the same work a 32 bit OS can do with 4 GB RAM (well, the 3.x GB actually...) with a 64 bit OS I would need 8 GB of RAM for programming?

Please note that I'm only talking about everyday x86 computers here.

share|improve this question

migrated from stackoverflow.com Sep 20 '09 at 19:20

This question came from our site for professional and enthusiast programmers.

5 Answers 5

up vote 4 down vote accepted

There will generally be some increase, but rarely near double. Some info here :

http://www.codeguru.com/cpp/cpp/cpp%5Fmfc/tutorials/article.php/c15711/

share|improve this answer
    
that seems to confirm what I was afraid of... –  Buttercup Sep 20 '09 at 20:02
    
no it does not confirm what you are afraid of. 1024 floats are still 1024 * 32bit. only the ptr pointing to that array is now 8byte instead of 4. –  akira Sep 20 '09 at 20:22
    
I'd say that if you weren't struggling for memory in the first place, switching to 64-bit won't make any major difference. The article says in most situations the difference is tiny. –  CodeByMoonlight Sep 20 '09 at 21:30

Not at all, although there is a slight overhead on a 64 bit OS the real difference is in the amount of memory they are able to use not the amount that they need. So the primary difference is that they use 64bits to store memory addresses.

share|improve this answer

ehh...

I have noticed that typically when you install x64 over x86 system, programs that are compiled for just x64 typically take up a bit more memory, however it is only marginal.

That being said, as always, more memory is always better!

share|improve this answer

The memory usage will of couse increase somewhat, but far from double. References will be twice the size, and some structures will be larger due to a different alignment, but it doesn't affect all data types. If you have a byte array, the bytes will still be stored end to end, there is no seven byte padding for each byte of data.

The word size on a 64 bit system is of course 64 bits. The x86 assembly data type WORD is still 16 bits, so a system word is a QWORD.

share|improve this answer

32-bit systems use 32-bit instructions, and 64-bit systems use 64-bit instructions. In other words, the CODE part of your programs will take more space. That's only a small bit of your total memory use though. Everything else -- the DATA etc. -- won't change much; a 16-million color image is still the same amount of data, on either architecture.

share|improve this answer
3  
Instruction size isn't usually related to address space or register size. In x86, op-codes are irregular numbers of bytes, whether it's 32 or 64-bit. –  bobince Sep 21 '09 at 0:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.