VMware vSphere vCenter Server 4.0 User Manual

Page 35

Advertising
background image

To determine the effectiveness of memory sharing for a given workload, try running the workload, and use

resxtop

or

esxtop

to observe the actual savings. Find the information in the

PSHARE

field of the interactive mode

in the Memory page.

Measuring and Differentiating Types of Memory Usage

The Performance tab of the vSphere Client displays a number of metrics that can be used to analyze memory

usage.
Some of these memory metrics measure guest physical memory while other metrics measure machine memory.

For instance, two types of memory usage that you can examine using performance metrics are guest physical

memory and machine memory. You measure guest physical memory using the Memory Granted metric (for

a virtual machine) or Memory Shared (for an ESX/ESXi host). To measure machine memory, however, use

Memory Consumed (for a virtual machine) or Memory Shared Common (for an ESX/ESXi host). Understanding

the conceptual difference between these types of memory usage is important for knowing what these metrics

are measuring and how to interpret them.
The VMkernel maps guest physical memory to machine memory, but they are not always mapped one-to-one.

Multiple regions of guest physical memory might be mapped to the same region of machine memory (in the

case of memory sharing) or specific regions of guest physical memory might not be mapped to machine

memory (when the VMkernel swaps out or balloons guest physical memory). In these situations, calculations

of guest physical memory usage and machine memory usage for an individual virtual machine or an ESX/ESXi

host differ.
Consider the example in the following figure. Two virtual machines are running on an ESX/ESXi host. Each

block represents 4 KB of memory and each color/letter represents a different set of data on a block.

Figure 3-3. Memory Usage Example

virtual machine

1

guest virtual memory

guest physical memory

machine memory

e

e

e

f

f

f

a

a

a

a

a

b

b

b

b

b

c

c

c

c

c

d

d

d

virtual machine

2

The performance metrics for the virtual machines can be determined as follows:

n

To determine Memory Granted (the amount of guest physical memory that is mapped to machine

memory) for virtual machine 1, count the number of blocks in virtual machine 1's guest physical memory

that have arrows to machine memory and multiply by 4 KB. Since there are five blocks with arrows,

Memory Granted would be 20 KB.

n

Memory Consumed is the amount of machine memory allocated to the virtual machine, accounting for

savings from shared memory. First, count the number of blocks in machine memory that have arrows

from virtual machine 1's guest physical memory. There are three such blocks, but one block is shared with

virtual machine 2. So count two full blocks plus half of the third and multiply by 4 KB for a total of 10 KB

Memory Consumed.

The important difference between these two metrics is that Memory Granted counts the number of blocks with

arrows at the guest physical memory level and Memory Consumed counts the number of blocks with arrows

at the machine memory level. The number of blocks differs between the two levels due to memory sharing

and so Memory Granted and Memory Consumed differ. This is not problematic and shows that memory is

being saved through sharing or other reclamation techniques.

Chapter 3 Managing Memory Resources

VMware, Inc.

35

Advertising
This manual is related to the following products: