IP Library › Granted Patent US 12,737,213
Granted Patent B2
US 12,737,213 · App. 18/505,014 · Granted Sep 15, 2026

Flexible memory management for virtual machines

Inventors: Vaibhav Balwant Nagarnaik (Santa Clara, CA); Rahul Chaturvedi (Mountain View, CA); Steven Aaron Richman (San Francisco, CA)
Assignee: Google LLC
G06F9/45558G06F2009/45583
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,737,213
App. No.
18/505,014
Granted
Sep 15, 2026
Kind
B2
Abstract

A virtual machine monitor (VMM) of a computing system may provide flexible memory management for guest virtual machines (guest VMs). The VMM may allocate a flexible amount of memory that is accessible to a guest VM. A guest VM may be configured, such as by VMM, to utilize a larger fixed amount of guest memory. A memory access error may be generated when guest VM accesses a memory location outside of the flexible memory. The VMM may receive the memory access error and allocate additional memory including at least the memory location to the flexible memory. The memory location may then be accessed without triggering a failure.

Claims (53)

1 . A method comprising:

allocating, by a virtual machine monitor executing at a host computing system, an amount of memory for a guest virtual machine, the amount of memory being less than a maximum amount of memory the guest virtual machine is configured to utilize, wherein the host computing system provides an execution environment for the guest virtual machine; and

after starting a boot process of the guest virtual machine:

monitoring, by the virtual machine monitor, memory pressure of the guest virtual machine;

responsive to an attempt to access a memory location of the guest virtual machine that is unallocated, receiving, by the virtual machine monitor, a memory access error that includes an indication of the memory location that was attempted to be accessed;

responsive to determining, by the virtual machine monitor, that an amount of available memory of the host computing system satisfies a threshold amount of available memory:

responsive to receiving the memory access error and based on the memory pressure, allocating, by the virtual machine monitor, additional memory for the guest virtual machine by reducing an amount of memory allocated to a virtual balloon, wherein the additional memory includes the memory location, and wherein the amount of memory allocated to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon, wherein the additional memory is not allocated where the amount of available memory of the host computing system does not satisfy the threshold amount of available memory; and

accessing, by the virtual machine monitor, the memory location.

2 . The method of claim 1 , wherein accessing the memory location completes an instruction being executed by the guest virtual machine that triggered the memory access error.

3 . The method of claim 1 , wherein the virtual machine monitor determines whether the amount of available memory of the host computing system satisfies the threshold amount of available memory before any adjustment of the amount of memory allocated to the virtual balloon.

4 . The method of claim 1 , further comprising:

responsive to determining, based on the memory pressure, that the amount of memory allocated to the guest virtual machine can be reduced, increasing, by the virtual machine monitor, the amount of memory allocated to the virtual balloon.

5 . The method of claim 4 , further comprising:

responsive to the virtual machine monitor adjusting the amount of memory allocated to the virtual balloon, receiving an updated memory pressure, and

selectively adjusting, based on the updated memory pressure, the amount of memory allocated to the guest virtual machine.

6 . The method of claim 1 , wherein receiving the memory access error comprises intercepting, by the virtual machine monitor, the memory access error before the memory access error is received by the guest virtual machine.

7 . The method of claim 1 , wherein monitoring, by the virtual machine monitor, the memory pressure of the guest virtual machine further comprises:

periodically retrieving pressure stall information from an operating system of the host computing system.

8 . A computing system comprising:

a memory that stores instructions; and

one or more processors that execute the instructions to:

allocate an amount of memory for a guest virtual machine, the amount of memory being less than a maximum amount of memory the guest virtual machine is configured to utilize, wherein the computing system provides an execution environment for the guest virtual machine; and

after starting a boot process of the guest virtual machine:

monitor memory pressure of the guest virtual machine;

responsive to an attempt to access a memory location of the guest virtual machine that is unallocated, receive a memory access error that includes an indication of the memory location that was attempted to be accessed;

determine an amount of available memory of the computing system;

responsive to receiving the memory access error and based on the memory pressure and the amount of available memory of the computing system satisfying a threshold amount of available memory:

allocate additional memory for the guest virtual machine by at least reducing an amount of memory allocated to a virtual balloon, wherein the additional memory includes the memory location, and wherein the amount of memory allocated to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon; and

access the memory location; and

responsive to receiving the memory access error and based on the memory pressure and the amount of available memory of the computing system not satisfying the threshold amount of available memory:

refrain from reducing the memory allocated to the virtual balloon.

9 . The computing system of claim 8 , wherein accessing the memory location completes an instruction being executed by the guest virtual machine that triggered the memory access error.

10 . The computing system of claim 8 , wherein the one or more processors further execute the instructions to determine whether the amount of available memory of the computing system satisfies the threshold amount of available memory before any adjustment of the amount of memory allocated to the virtual balloon.

11 . The computing system of claim 8 , wherein responsive to determining, based on the memory pressure, that the amount of memory allocated to the guest virtual machine can be reduced, the one or more processors further execute the instructions to increase the amount of memory allocated to the virtual balloon.

12 . The computing system of claim 8 , wherein responsive to adjusting the amount of memory allocated to the virtual balloon, the one or more processors further execute the instructions to:

receive, an updated memory pressure, and

selectively adjust, based on the updated memory pressure, the amount of memory allocated to the guest virtual machine.

13 . A non-transitory computer-readable storage medium comprising instructions, that when executed by one or more processors of a computing system, cause the one or more processors to:

allocate an amount of memory for a guest virtual machine, the amount of memory being less than a maximum amount of memory the guest virtual machine is configured to utilize, wherein the computing system provides an execution environment for the guest virtual machine; and

after starting a boot process of the guest virtual machine:

monitor memory pressure of the guest virtual machine;

responsive to an attempt to access a memory location of the guest virtual machine that is unallocated, receive a memory access error that includes an indication of the memory location that was attempted to be accessed;

determine an amount of available memory of the computing system;

responsive to receiving the memory access error and based on the memory pressure and the amount of available memory of the computing system satisfying a threshold amount of available memory:

allocate additional memory for the guest virtual machine by at least reducing an amount of memory allocated to a virtual balloon, wherein the additional memory includes the memory location, and wherein the amount of memory allocated to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon; and

access the memory location; and

responsive to receiving the memory access error and based on the memory pressure and the amount of available memory of the computing system not satisfying the threshold amount of available memory:

refrain from reducing the memory allocated to the virtual balloon.

14 . The non-transitory computer-readable storage medium of claim 13 , wherein responsive to determining, based on the memory pressure, that the amount of memory allocated to the guest virtual machine can be reduced, the one or more processors further execute the instructions to:

increase the amount of memory allocated to the virtual balloon;

responsive to adjusting the amount of memory allocated to the virtual balloon, receive an updated memory pressure, and

selectively adjust, based on the updated memory pressure, the amount of memory allocated to the guest virtual machine.

15 . The non-transitory computer-readable storage medium of claim 13 , wherein accessing the memory location completes an instruction being executed by the guest virtual machine that triggered the memory access error.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE FIRST INVENTOR'S NAME PREVIOUSLY RECORDED AT REEL: 65502 FRAME: 716. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT . Recorded Aug 2, 2024
From: NAGARNAIK, VAIBHAV BALWANT; CHATURVEDI, RAHUL; RICHMAN, STEVEN AARON
To: GOOGLE LLC
Reel/Frame 068279/0877 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 8, 2023
From: BALWANT, VAIBHAV BALWANT; CHATURVEDI, RAHUL; RICHMAN, STEVEN AARON
To: GOOGLE LLC
Reel/Frame 065502/0716 →
Continuity (1)
Related Publication 20250147786A1 · May 8, 2025
References Cited (19)
US 8583875B1 · Garthwaite · 2013 [cited by examiner]
US 9910768B1 · Melekhova et al. · 2018 [cited by applicant]
US 9910774B1 · Gupta · 2018 [cited by examiner]
US 10474359B1 · Volpe · 2019 [cited by examiner]
US 12367056B2 · Apfelbaum · 2025 [cited by examiner]
US 20120233435A1 · Ben-Yehuda · 2012 [cited by examiner]
US 20160253263A1 · Takada · 2016 [cited by examiner]
US 20190149399A1 · Reed · 2019 [cited by examiner]
US 20190361728A1 · Kumar · 2019 [cited by examiner]
US 20200192579A1 · Cavilla et al. · 2020 [cited by applicant]
US 20220171644A1 · Hildenbrand · 2022 [cited by examiner]
US 20230315561A1 · Wang · 2023 [cited by examiner]
CN 116991537A · 2023 [cited by examiner]
WO WO2013103341A1 · 2013 [cited by examiner]
WO WO2015132753A1 · 2015 [cited by examiner]
Kim J, Fedorov V, Gratz PV, Reddy AN. Dynamic memory pressure aware ballooning. InProceedings of the 2015 International Symposium on Memory Systems Oct. 5, 2015 (pp. 103-112). (Year: 2015). [cited by examiner]
Li X, Chen R, Zhang B, Li C. A Dynamic Memory Allocation Approach Based on Balloon Technology on Virtualization Platform. InJournal of Physics: Conference Series Feb. 1, 2019 (vol. 1169, No. 1, p. 012038). IOP Publishin… [cited by examiner]
Moniruzzaman AB. Analysis of memory ballooning technique for dynamic memory management of virtual machines (vms). arXiv preprint arXiv: 1411.7344. Nov. 26, 2014. (Year: 2014). [cited by examiner]
Github, “VirtIO Memory Ballooning”, Apr. 18, 2022, 4 pp., Retrieved from the Internet https://pmhahn.github.io/virtio-ballon/#:~: text=VirtIO%20provides%20Memory%20Ballooning%3A%20the,other%20tasks%20inside%20the%20 VM … [cited by applicant]