This application discloses a memory management method and apparatus, a device, a storage medium, and a computer program, and pertains to the field of computer technologies. The method includes: receiving a memory allocation request, where the memory allocation request is used to request to allocate a memory range to a target VM; obtaining sizes, physical addresses, and allocation statuses of a plurality of encrypted memory ranges, where the plurality of encrypted memory ranges correspond to different keys; selecting one encrypted memory range from the plurality of encrypted memory ranges as a target encrypted memory range based on the sizes and the allocation statuses of the plurality of encrypted memory ranges; and allocating the target encrypted memory range to the target VM based on a physical address of the target encrypted memory range. This process is applicable to different processor architectures without changing a hardware architecture.
Full Text
What is claimed is: