CPC G06F 9/45558 (2013.01) [G06F 9/45545 (2013.01); G06F 9/5016 (2013.01); G06F 9/542 (2013.01); G06F 2009/45579 (2013.01); G06F 2009/45583 (2013.01)] | 19 Claims |
1. A method comprising:
receiving, by a processing device, a request associated with a memory balloon;
searching for available memory chunks in a memory, wherein the memory is fragmented and comprises a set of available chunks that are separate from each other, wherein the set of available memory chunks is represented by a data structure comprising a plurality of sets, and wherein the plurality of sets comprises a first set comprising a list identifying available chunks that comprise a first size and a second set comprising a list identifying available chunks that comprise a second size, wherein the first size is smaller than the second size;
selecting, by the processing device, a first chunk and a second chunk of the set of available chunks, wherein the first chunk is smaller than the second chunk and is selected before the second chunk;
associating the first chunk and the second chunk with the memory balloon;
associating an adjacent chunk with the memory balloon, wherein the first chunk and the adjacent chunk are merged to produce a coalesced chunk, wherein the coalesced chunk is associated with the memory balloon; and
providing information of the memory balloon to a hypervisor, wherein the hypervisor uses the information to manage a host physical memory.
|