# US 2025/0147786 A1 · Flexible memory management for virtual machines

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0147786 A1
- Document ID: US20250147786A1
- Status: Published application
- Kind: A1
- Application number: 18/505,014
- Filed: 2023-11-08
- Published: 2025-05-08
- Earliest claimed: 2023-11-08
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Vaibhav Balwant Nagarnaik; Rahul Chaturvedi; Steven Aaron Richman
- Web page: https://patentgrep.com/patent/US20250147786A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## 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

### Claim 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:
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 receiving the memory access error, allocating, by the virtual machine monitor, additional memory for the guest virtual machine, wherein the additional memory includes the memory location; and
accessing, by the virtual machine monitor, the memory location.

### Claim 2 (depends on 1)

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.

### Claim 3 (depends on 1)

The method of claim 1, wherein allocating the additional memory for the guest virtual machine comprises causing, by the virtual machine monitor, the host computing system to allocate the additional memory by at least adjusting an amount of memory allocated to a virtual balloon.

### Claim 4 (depends on 3)

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

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
monitoring, by the virtual machine monitor, memory pressure of the guest virtual machine, and
selectively adjusting, based on the memory pressure, the amount of memory allocated to the guest virtual machine.

### Claim 6 (depends on 5)

The method of claim 5, wherein selectively adjusting the amount of memory allocated to the guest virtual machine comprises:
responsive to determining, based on the memory pressure, that the guest virtual machine is to be allocated additional memory, reducing, by the virtual machine monitor, the amount of memory allocated to a virtual balloon, wherein the amount of memory allocated by a host computing system to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon.

### Claim 7 (depends on 6)

The method of claim 6, wherein selectively adjusting the amount of memory allocated to the guest virtual machine comprises:
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, wherein the amount of memory allocated by a host computing system to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon.

### Claim 8 (depends on 6)

The method of claim 6, 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.

### Claim 9 (depends on 6)

The method of claim 6, further comprising:
determining, by the virtual machine monitor, an amount of available memory of the host computing system; and
refraining from reducing the memory allocated to the virtual balloon in response to determining that the amount of available memory of the host computing system does not satisfy a threshold amount of available memory.

### Claim 10

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:
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;
responsive to receiving the memory access error, allocate additional memory for the guest virtual machine, wherein the additional memory includes the memory location; and
access the memory location.

### Claim 11 (depends on 10)

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

### Claim 12 (depends on 10)

The computing system of claim 10, wherein allocating the additional memory for the guest virtual machine comprises allocating the additional memory by at least adjusting an amount of memory allocated to a virtual balloon.

### Claim 13 (depends on 12)

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

### Claim 14 (depends on 10)

The computing system of claim 10, wherein the one or more processors further execute the instructions to:
monitor memory pressure of the guest virtual machine, and
selectively adjust, based on the memory pressure, the amount of memory allocated to the guest virtual machine.

### Claim 15 (depends on 14)

The computing system of claim 14, wherein selectively adjusting the amount of memory allocated to the guest virtual machine comprises:
responsive to determining, based on the memory pressure, that the guest virtual machine is to be allocated additional memory, reducing the amount of memory allocated to a virtual balloon, wherein the amount of memory allocated by a host computing system to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon.

### Claim 16 (depends on 15)

The computing system of claim 15, wherein selectively adjusting the amount of memory allocated to the guest virtual machine comprises:
responsive to determining, based on the memory pressure, that the amount of memory allocated to the guest virtual machine can be reduced, increasing the amount of memory allocated to the virtual balloon, wherein the amount of memory allocated by a host computing system to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon.

### Claim 17 (depends on 15)

The computing system of claim 15, further comprising:
responsive to 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.

### Claim 18 (depends on 15)

The computing system of claim 15, wherein the one or more processors further execute the instructions to:
determine an amount of available memory of the computing system; and
refraining from reducing the memory allocated to the virtual balloon in response to determining that the amount of available memory of the host computing system does not satisfy a threshold amount of available memory.

### Claim 19

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:
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;
responsive to receiving the memory access error, allocate additional memory for the guest virtual machine, wherein the additional memory includes the memory location; and
access the memory location.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein the one or more processors further execute the instructions to:
monitor memory pressure of the guest virtual machine;
responsive to determining, based on the memory pressure, that the guest virtual machine is to be allocated additional memory, reduce the amount of memory allocated to a virtual balloon, wherein the amount of memory allocated by a host computing system to the guest virtual machine is inversely proportional to the amount of memory allocated to the virtual balloon;
determine an amount of available memory of the computing system; and
refrain from reducing the memory allocated to the virtual balloon in response to determining that the amount of available memory of the computing system does not satisfy a threshold amount of available memory.
