Dynamic Memory Allocation Technique for Virtual Machines Gauhar Eram Shaikh
Urmila Shrawankar
Department of Computer Science and Engineering G. H. Raisoni College of Engineering Nagpur, (MS), India
[email protected]
Department of Computer Science and Engineering G. H. Raisoni College of Engineering Nagpur, (MS), India
[email protected]
memory to maintain the performance of the applications running on it. Dynamic approach looks more promising solution to allocate memory in which memory can be adjusted on run time.
Abstract—Virtualization technology is drawing a renewed attention from variety of application domain such as data centres, desktop computing and cloud computing etc. Virtualization improves the utilization of hardware resources such as network I/O, processor and memory. Allocating an appropriate amount of main memory resource to virtual machines is challenging task. Static allocation is one approach for managing memory but it leads to inefficient memory utilization. Different application have different memory requirements, even a single application shows varied working set during its execution therefore an optimal memory management technique under a virtualized environment is needed to manage memory dynamically. This paper proposes an efficient memory management technique which includes global allocation technique along with memory releasing and memory growing technique for satisfying the memory demand on run time. The result of this methods leads to better memory utilization, improves the performance of the overall system and maximizes the memory usage Keywords— virtualization; management, global allocation.
virtual
machine;
Proposed model is different from the fore mentioned researches as guest and host OS (operating system) kernel details don’t get changed. This paper present an efficient dynamic memory management model for multiple virtual machines which offer global allocation methods to cope up with different scenarios, which could keep dynamic balance between multiple virtual machines. The rest of this paper is organized as follows: section 2 presents the Existing work, section 3 focuses on System architecture and its component, Memory Allocation methods describe in section 4, Analysis and results are presented in section 4 and section 5 concludes.
memory
II. EXISTING WORK I.
INTRODUCTION
There are various work focusing on memory management in virtualization environments, such as page sharing, memory mapped I/O [5][6], ballooning[4][17][3], hotplug[7]. All these techniques are widely used by many hypervisors for memory management[4][3]. Several Kind of work for memory allocation is discussed below.
Recently, Virtualization technology proved out to be a big revolution because of its promising benefits. It has been widely used in cloud computing, data centre, desktop computing, and cyber physical system[1][2]etc. It allows multiple commodity operating systems instances or virtual machines (VMs) to run on a single physical machine. In simple word it means splitting up a single physical computer into several virtual computers. Virtual machine monitor (VMM), hypervisor in short is a piece of computer software that manages the hardware resource for VMs [3]. The hypervisor abstracts the hardware resources including CPU, memory, and I/O devices and then allocates them as virtual CPU, virtual memory, and virtual I/O devices to the VMs. These resources are shared among virtual machines using time slicing techniques. For example network interfaces can be assigned to a virtual machine when needed and given it up when there is no demand, but when it comes to memory allocation; it is a relatively challenging problem. The memory allocation in virtual machine is mostly static that means fixed memory size pool is allocated to each virtual machine instance at boot [4]. Though various works has been done to resize memory at runtime, existing studies are insufficient to tell when to reallocate and deallocate memory to maintain the performance of the applications running on it. Dynamic approach looks more promising solution to allocate
Xiao, et al. proposed anapproach to memory demand prediction by leveraging an exponentially weighted moving average (EWMA) scheme[10]. Transcendent Memory[12] provides sharable memory pools among different VMs to manage the physical memory. The hypervisor collects idle memory from different VMs and manages it as one or more physical memory pools. A guest OS can indirectly access this memory with a well defined API which imposes a carefully crafted set of rules and restrictions. From the perspective of a guest OS, A memory pool appears to be fast RAM disk with on deterministic varying size. A guest OS may used memory pool as an extension to its memory, thus reduce disk I/O and improve performance. However, the management of memory pools is very complicated. Xen Platform[13] provide Dynamic Memory Control, which can change the amount of host physical memory assigned to any running virtual machine without rebooting it,
1
but it fails to make a flexible response to a virtual machine which has a serious complicated tasks. Huazhong[14] University also presented a prediction model by analyzing historical data of each virtual machine to relocate its memory. All these methods are based on forecast accuracy, therefore, a wrong prediction will lead to a negative effect.
(the memory utilization of guest domain). MMC will be present in each virtual machine and it’s another important function is to send information to MSD by using the virtual machine communication interface (VMCI). used
2) ICC: It consists of two parts, Physical Machine information (PMIC) and Virtual Machine information collector (VMIC) and. PMIC is used to collect the size of total and idle memory in host machine etc. VMIC is used to collect the guest machine information like each guest machine has a configuration file, which includes Mi-max (the maximal memory utilization of guest domain) and Mi-min (the minimal memory utilization of guest domain) and other parameter to control its memory in different range.
ZhangW showed lightweight virtual[16] machine memory management architecture for virtual computing which provided method by using tax rate to relocate memory of different virtual machines. It also contain self and global adjusment policies to adjust the memeories but it requires a complex calculation, which may cause additional overhead. Dan Magenheimer[15] presented a “memory overcommit” that an operating system running on a virtual machine (denoted as guest OS) submitted its own statistical information to guide memory reallocation. Besides lottery scheduling[18-19] for multiple virtual machines is provided which could tell which guest OS needed to reclaim memory resources, but did not specify how much.
3) MAC: Memory allocator component manage all guest virtual machine’s memory. It releases certain amount of memory from guest when it has plenty of memory in that guest domain, and also expand a guest domain’s memory when there is need of extra memory. It also used global allocation technique to adjust memory among all guest domains. All these methods of memory allocator is discussed in section 4.
III. SYSTEM MODEL
4) MSD: It store all guest domain’s memory status along with configuration information provided by VMIC. It also collect host memory information through PMIC. MSD present in host machine and updates periodically.
As illustrated in figure 1 virtual machine monitor can be divided into five components: information collector component (ICC), memory monitoring component (MMC), memory statistics database (MSD) and memory allocator component (MAC).
Implementation Steps is described as follows: Install and Configure VMs
Add MMC in guest domains
Maintain MSD in host domains
Add ICC in host and guest domains
Run memory allocator in host domain Fig. 2 System model
Fig.1 Architecture of memory management
To make the formulation easy, the symbols of memory resource meaning are given below in Table 1.
1) MMC: It is responsible for monitoring the memory information, which consists of three parts: M-total (total memory of guest domain), VMid (ID of guest domain), and Mi-
2
TABLE .1
SYMBOLS AND SYSTEM INFORMATION
SYMBOLS
EXPLANATION
VMid
Id of guest domain
Mi-total
Total memory of guest Domaini.
Mi-used
Memory utilization of guest Domaini.
Mi-max
Maximum memory of guest Domaini.
Mi-min
Minimum memory of guest Domaini.
Fi
Size of free memory in guest Domaini.
Th
Size of available memory in physical Domaini.
Fh
Size of free memory in host Domaini.
Uh
Memory utilization of host Domain.
Mi-needed
Memory required to guest Domaini.
Mi-added
Memory added to guest Domaini.
all guest domain and assign memory to the virtual machine which is in need. Step 9: After executing all above processes, MAC will return to step 1 for the next round. The flow chart of memory allocation strategy is given below in figure. 2. Start
Get MMC from VMs
Get information from ICC
Update information in MSD
Y Y
Whether in a reasonable range??
Steps of working will be as follows:
N
Step 1: Gets host machine’s memory details through PMIC. PMIC consist of three information a) Th (total memory of host domain) b) Fh(free memory of host domain) c) Uh(memory utilization of host domain).
Y
Step 2: Get the maximal memory utilization(Mi-max) and minimum memory utilization (Mi-min) from virtual machine’s through configuration file provided by the VMIC .
b) c)
Y
Is there enough host memory??
N
Step 3: Get memory information of all guest Domains from MMC, Which consist of three information : a)
N
Whether any VM is lack in memory??
Is there enough memory in any VMs??
VMi (Virtual machine’s id) i=1,2…..N (N is no. of all guest domain). Mi-total(total memory of guest domaini) Mi-used(total memory utilization of guest domaini).
N
Y Run memory releasing algorithm
Step 4: Memory staitstics database(MSD) will store memory status information of host and guest domain which is collected in step1, 2 and 3.
Run global memory allocation algorithm
Step 5: If Mi-min < Mi-used < Mi-max , that means guest domaini’s memory usage is within range , do nothing, then go back to step 1, else step 6.
N Whether end??
Step 6: If Mi-used > Mi-max that means VMi is lacking of memory, then memory allocator in host machine will increase the guest domaini’s memory size. At this point important is that guest domain is in need of extra memory so memory get allocated from host machine by runing memory growing algorithm, else go to step 7.
Y End
Fig. 3 Flow chart
Step 7: If Mi-used < Mi-min, that mean guest domaini’s is having enough memory and run memory releasing algorithm. Step 8: If step 7 fails to allocate memory then global memory allocation method is responsible to release the memory from
3
Run memory growing algorithm (MGA)
IV.
If one of virtual machine VMi is lacking in memory and no host memory is available in order to satisfy the need of virtual machine’s memory demand MAC method will release memory from the other guest domain who is having sufficient amount of free memory to fulfil the memory demand. First it checks memory statistics database and check the guest domains memory status using equations Mi-used