Free memory tax algorithm for VMware memory mechanisms

Source: Internet
Author: User

I have posted a post on the VMware Memory mechanism in Vmsky's forum (see this http://bbs.vmsky.com/thread-23285-1-2.html), and the last example is an account of the free memory tax (Idle Memory Tax, hereinafter referred to as IMT) in the case of memory allocation calculations, but unfortunately the guess of the algorithm was wrong. After reading Carl's paper on the memory mechanism today, I was deeply obliged to explain it again.

The free Memory tax (Idle Memory Tax) is set by VMware to make more efficient use of host memory, which distinguishes between free memory (Idle Memory) and active memory (active Memory) in the VM when calculating how host memory is allocated. A punitive calculation of free memory makes it possible for a VM with more free memory to gain a smaller share of memory.

This is explained on the <vsphere Resource Management guide> p98 page:

Mem.idletax, specifies the idle memory tax rate, as a percentage. This tax effectively charges virtual machines the more for idle memory than for memory they are actively using. A tax rate of 0 percent defines an allocation policy then ignores working sets and allocates memory strictly based on Shar Es. A High tax rate results, allocation policy that allows idle, memory to is reallocated away from virtual machines are unproductively hoarding it.

Default:75

This explanation shows that IMT is a percentage of the number, between 0-100 and IMT is 0, ignoring working set and allocating the memory exactly according to shares.

So what's the effect of this default 75% tax penalty?

Carl's paper mentions a very important parameter: the share of memory than the Rho

which

Rho is Shares-per-page ratio, which is the share proportion of unit memory.

F is active memory as a percentage of total memory

K is the penalty factor, k=1/(1-IMT), such as IMT is 75%, then k=4

P is the total page number of memory, S is the share

This formula is not very good understanding, let us change a way of writing, it is easy to understand.

P is the total memory of the VM configuration, F is the proportion of active memory, so P F is the number of active memory, p · (1-f) is the amount of free memory, so the formula above can be expressed as:

When the host is out of memory, the ESX host will find the smallest of the VM to return to memory (reclaim).

Give an example to illustrate.

Host has 4GB of memory, VM1 and VM2 each configured 4GB memory, configuration share is 40960. VM2 Run 1 memory-consuming programs, no free memory, VM2 ρ=10. VM1 has 50% of free memory, which is 2GB idle, 2GB activity, and IMT is the default 75%,k=4,ρ=40960/(2048+4*2048) =4

Because the VM1 and VM2 are configured with the same memory, the memory that VM1 and VM2 can compete for is 4:10, that is, VM1 can get 1.14GB host physical memory, and VM2 can get 2.86GB memory.

Of course. The memory allocation in practical applications is not as rigid as computation, but a continuous process of continual adjustment.

This article is from the "Delxu Live notepad" blog, please be sure to keep this source http://delxu.blog.51cto.com/975660/288012

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.