Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In the old times (before virtualization), memory came in powers/multiples of 2, because that is the way memory is manufactured. Nowadays that we create virtual servers that don't have real physical memory, people still create them using powers/multiples of 2.

Is there any reason to continue doing this (performance or others) or is this just something that people do because that is what they are used to?

share|improve this question
    
I had a machine with 192MiB physical RAM once, bo problem at all. There should be no real reasons to have memory a power of two (I say "should", as there is no way to predict the extent of the brain damage in some operating system...). –  vonbrand Apr 10 '13 at 13:32
add comment

3 Answers

up vote 1 down vote accepted

The answer to your question usually lies more within the guest OSes than the hypervisor used. Windows has, for many year, not really cared whether the memory was laid out in any particular way, save a few requirements on it looking like a PC, so that the boot loader works. Linux is similarly flexible.

Hyper-V, as an example, assigns memory to guest OSes in 2MB chunks. This is only so that the page table hardware in the processors can be set up to use 2MB pages, which is more efficient in that it uses less memory for page tables and fewer entries in the TLB within the processor.

share|improve this answer
add comment

There's no reason to continue that trend, at least for VMware... Same for CPUs. I'm not ashamed to say that I have some 3-CPU virtual machines out there 🐼.

share|improve this answer
    
AMD built 3 core phenom processors, so it can't be that bad :) –  SvW Apr 10 '13 at 13:16
1  
@SvW I thought AMD 3-core CPUs were faulty quad-core ones... –  tombull89 Apr 10 '13 at 13:19
    
@tombull89 I could very well imagine this to be the case but I don't know for a fact. Intel did something similar back in the days with the 80486SX, which was the same as the DX but with the 487 coprocessor disabled. –  SvW Apr 10 '13 at 13:27
add comment

I suspect every VM product still uses multiples of four bytes. Not two.

Note that 3 MB is 3072 KB, which is a multiple of two and four (2x1536, or 4x768) even though that is not instantly clear when you look at the value 3.

( As to why multiples of 2 or 4 bytes: Memory access is usually 1, 2 or 4 bytes wide. )

share|improve this answer
add comment

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.