Virtual Machine Memory Management via Dynamic Zram Sizing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Virtual machine memory management is memory-bound, leading to performance degradation due to long latency in disk I/O operations during memory swapping, and existing memory compression techniques, such as the zram driver, require dynamic adjustment to balance pseudo and true page fault overheads.
Innovation Solution
A memory management method that maintains a least recently used (LRU) list to distribute memory pages across virtual memory, a zram driver, and a swap disk, dynamically adjusting the zram driver's space based on access probabilities and fault overheads to optimize memory utilization.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If memory compression is done by compressing swapped-out pages into smaller size and storing them in memory (zram driver), then the swapin speed is improved compared to disk access, but the guest OS consumes more guest memory and generates more swap-in/out operations
Solution Approach 1:
The patent dynamically adjusts the zram driver size based on system conditions and workload characteristics. The optimization module monitors memory access patterns, swap operation frequency, and system performance metrics to adaptively resize the zram driver, ensuring optimal balance between compression benefits and memory consumption at different operational phases
Solution Approach 2:
The patent changes key parameters including compression algorithms (e.g., LZ4, Zstd), zram driver size, and swap threshold values based on workload analysis. By adjusting these parameters dynamically, the system optimizes the trade-off between compression ratio, CPU overhead, and memory usage for different application scenarios
2Loss of time
If the zram driver size is increased to store more compressed pages, then the pseudo page fault overhead is reduced, but the available memory for other purposes decreases
Solution Approach 1:
The system continuously monitors page fault rates, swap operation frequency, and memory pressure metrics to dynamically adjust zram driver size. When pseudo page faults occur frequently, the zram driver is expanded to reduce them. When memory pressure increases or compression effectiveness decreases, the driver size is reduced to free up memory resources
Solution Approach 2:
The optimization module implements feedback mechanisms that monitor system performance metrics including page fault rates, swap-in/out frequencies, and memory utilization. Based on this feedback, the system automatically adjusts zram driver size and compression settings to maintain optimal performance while preventing resource exhaustion
3Quantity of substance
If host swapping is used to reclaim memory from virtual machines by shifting pages to physical swap disk, then memory utilization of the hypervisor is increased, but the latency is highly unsatisfactory due to long disk I/O
Solution Approach 1:
The patent introduces the zram driver as an intermediary layer between the guest OS and the physical swap disk. Pages are first compressed and stored in the zram driver (in-memory compression buffer) before being written to the swap disk. This intermediary approach reduces the frequency and volume of disk I/O operations by handling frequently accessed pages in memory
Solution Approach 2:
The patent segments the swap storage into two parts: a fast in-memory compression buffer (zram driver) for frequently accessed pages, and a slower physical swap disk for less frequently accessed pages. This segmentation allows the system to optimize for speed when possible while maintaining high capacity for overall memory management
Data Source
AI summary
A method and a computer system for memory management on a virtual machine system are provided. The memory management method includes the following steps. A least recently used (LRU) list is maintained by at least one processor according to a last access time, wherein the LRU list includes a plurality of memory pages. A first portion of the memory pages are stored in a virtual memory, a second portion of the memory pages are stored in a zram driver, and a third portion of the memory pages are stored in at least one swap disk. A space in the zram driver is set by the at least one processor. The space in the zram driver is adjusted by the processor according to a plurality of access probabilities of the memory pages in the zram driver, an overhead of a pseudo page fault, and an overhead of a true page fault.


