Q. I've heard that virtualization memory sharing technologies aren't important with Windows Server 2008, Windows Vista, and later OSs. Why not?

A. Some hypervisors, such as VMware's, use memory sharing technologies, where duplicate memory page content from virtual machines (VMs) on the same host are only stored once in physical RAM.

The technology works by looking at the pages of memory, creating a hash value for each page of memory, looking for pages with the same hash value, doing a bit-by-bit comparison of the memory to ensure the content is identical, and then consolidating the pages to one physical copy. This process can take hours to complete.

Note that memory sharing looks for identical pages, which in the past have been 4KB in size. The odds of finding 4KB pages with the same content across OSs are pretty high and physical memory space will be saved. Processors have supported large memory pages for a long time now. Server 2008, Vista, later Windows OSs, and newer Linux OSs commonly use a 2MB memory page size by default. The chances of finding duplicate 2MB memory pages is very slight, which is why as OSs adopt large memory pages, memory sharing technologies lose their benefit.

Why do you want larger memory pages? All OSs work with virtual address spaces for memory—applications see a logical view of memory, not the real memory. This virtual address space has to be mapped to physical memory through page tables that essentially say, "this virtual address is actually this physical page." This lookup in the page table can take time, so you also have a translation lookaside buffer (TLB). The TLB is a very fast memory cache on the processor that stores recently accessed physical to virtual address space mappings, giving faster lookups for commonly used memory areas.

The TLB has a finite size and can only store a certain number of mappings, based on the TLB's size. If you use 2MB memory pages instead of 4KB pages, you drastically decrease the number of pages of memory that have to be accessed to retrieve data. The TLB can be used more frequently because more memory can be looked up using the TLB—essentially, 512 times as much memory is addressable using the TLB with large memory pages instead of small.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish