Skip to main content

When ESX host reclaim memory?

This is really interesting and important question for the VMware professional. Who and when will host reclaim the memory, the answers follows:

VMKernel is responsible for the reclaiming the memory. VMKernel decides to reclaim the host memory based on their four states. ESX maintains the four memory states:

High @ 6% - No Action
Soft @ 4% - Ballooning
Hard @2% - Swapping + Ballooning
Low @1% - Swapping

ESX effectively supports 3 memory reclaim techniques such as:

1. Transparent Share Paging (TPS)
2. Ballooning
3. Host Swapping

Now, the ESX will decide which memory reclaims technique to be used at when. However, TPS is enabled by default and continuously running in the ESX host, it is not considered.

Let’s see the how memory state is calculated:

Memory State % = Physical Memory – Service Console Memory

When the memory state equals to high state (6%) or virtual machines use less than 94% of host memory, there won’t be any reclaim process invoked. When the memory state start to fall down, it will start to use the Ballooning mechanism to reclaim the memory. Ballooning will be started to use at soft state or 4% and if memory state is still further falls down to Hard state (2%), swapping will be used with addition of ballooning. Even the memory state drastically drops down to Low state (1%), swapping will be used as last resort and additionally blocks the execution of VMs that consume more memory than their target allocation.

Some situation, the ballooning will be kicked when memory state between hard and soft. Because, the balloon driver will take some time to identify the free pages and allocate them back to required state. This would help us to avoid the situation of soft or worse.

In certain scenarios, host memory reclaims can happen. Such as, if the VM has limit, the VMKernel tries to use host reclaim the memory using either ballooning or swapping even though the host memory has plenty of memory left to free.

How to check the memory state of the host:
 
Either remote SSH or Direct console to your ESX host and type “esxtop” then press “m” memory status:
 
 
 
 
 
 
Free state value can be configured by host attributes in ESX3.5. I am not seeing this attribute in ESX4.0 and later editions. I don’t know whether VMware hidden those attributes and replaced with different name. Anyway, the following screenshot taken from ESX3.5 host advanced configuration:

Comments

Graham said…
What about ESX/i 4.1 memory compression? Where does that fit?

Actuall I just answered my own question by reading this: http://www.gabesvirtualworld.com/memory-management-and-compression-in-vsphere-4-1/

For some reason, I still press 'publish comment'

:)
Shan said…
Thanks Graham, I am just gathering the more information about memory compression. I will write up article soon. Thanks for the link as well.

Popular posts from this blog

vCenter Reinstallation after 60-Days trial expires without losing Database Contents

Many of us still evaluating the vSphere and vCenter in our test environments. Sometimes, it takes more than 60 days to evaluate where trial edition expires. We can't extend the trial edition in ESX host, either we have to reinstall it or license it. vCenter also have to follow the same way as ESX does. But, here we can keep old database contents as it is when you reinstall the vCenter software. This document using vCenter 4.0 and SQLEXPRESS 2005 (built in) database. At the time of installation of vCenter 4.0, it installs SQLEXPRESS 2005 by default unless any other Database specified. Mostly, we are using built-in database is SQLEXPRESS 2005 for testing environment. When you install vCenter 4.0, it installs SQLEXPRESS 2005 and creates a database called "SQLEXP_VIM". You can view this thru SQL Server Configuration Manager console. Start à All Programs à Microsoft SQL Server 2005 à Configuration Tools à SQL Server Configuration Manager Creating DSN Create a System DSN f

Set VLAN ID to IPMI Address in Nutanix

The IPMI is remote management interface like as HP iLO, DELL DRAC. During the Nutanix cluster deployment, it is not possible to mention the VLAN ID of the IPMI's IP Address. This need to be entered thru command line via ESXi host or Windows Hyper-V. This article talks about ESXi host only. Login to ESXi thru SSH client. Run the following command to enter the VLAN ID (we assume that you already configured IP Address) ~ # /ipmitool lan set 1 vlan id 333 ~ # /ipmitool lan print1 Set in Progress         : Set Complete Auth Type Support       : NONE MD2 MD5 PASSWORD  Auth Type Enable        : Callback : MD2 MD5 PASSWORD                          : User     : MD2 MD5 PASSWORD                          : Operator : MD2 MD5 PASSWORD                          : Admin    : MD2 MD5 PASSWORD                          : OEM      : MD2 MD5 PASSWORD  IP Address Source       : Static Address IP Address              : xx.xx.xx.xx Subnet Mask             : 255.255.254.0 MAC

How to reset HP iLO Password (DL 585 G2)

Today, I got into trouble with a HP Server. I need to hold remote console of the HP DL 585 G2 server. When I tried to access the console, prompted me to enter "Administrator" credential...Oops... no idea what is the password. I have not been known about this while KT from previous administrator. Now, I have to find a way to reset this password and access the server remotely. While searching, I ended up with 3 different ways to reset the password. All the 3 ways given below, you choose which one good for you: Resetting using SmartStart CD 1.         Boot the server using HP SmartStart CD 2.        Press F8 to goto iLO Configuration console 3.        Select the HP iLO setting 4.       Goto User setting 5.        Select the “Administrator” and change the password or Create new user with administrator privileges Resetting using Security Override Switch 1.         Look system board diagram server top bonnet 2.        Look for the system management switch (mostly no:11 on DL 58