Back to results
US 10,095,615 B2Granted
Garbage collection based on total resource usage and managed object metrics
AssigneeMicrosoft Technology Licensing, LLC
InventorsAbhinaba Basu, Jaiprakash Sharma, Srivatsan Kidambi
Life of this patent
Estimating the term…
Abstract
A method includes selectively controlling, at a computing device having a memory, initiation of a full garbage collection operation based on a total resource usage metric and a managed object metric. The managed object metric is based on objects managed by a runtime application.
Claims20
A system, comprising:
- at least one processor;
- and
- a memory coupled to the at least one processor, the memory storing:
- a heap;
- and
- a memory manager executable by the at least one processor to perform one or more operations including at least:
- selectively controlling initiation of at least one of a full garbage collection operation or an ephemeral garbage collection operation based on a total resource usage metric and a managed object metric, wherein the managed object metric is based on one or more runtime characteristics of a managed application that performs runtime calls to the one or more managed objects including at least:
- determining whether a ratio of the total resource usage metric to the managed object metric is greater than a threshold;
- when the ratio is greater than the threshold, initiating the full garbage collection operation including at least:
- suspending the managed application that performs runtime calls to one or more managed objects stored in the heap during the full garbage collection operation;
- determining whether each of the one or more managed objects in each generation of the heap is a reachable object or an unreachable object;
- adding the unreachable objects in each generation to a finalizer list;
- consolidating one or more managed objects that remain in the heap into a contiguous portion of the heap during the full garbage collection operation, including moving the reachable objects to a contiguous portion of the heap;
- performing the full garbage collection at least partially based on the finalizer list;
- and
- restarting execution of the managed application;
- and
- when the ratio is not greater than the threshold, performing the ephemeral garbage collection operation without suspending the managed application.
15 more elements
A method implemented using one or more processing devices, comprising:
- determining whether to initiate a full garbage collection operation or an ephemeral garbage collection operation on a heap stored within a memory of a device including determining whether a ratio of a total resource usage metric and a managed object metric is greater than a threshold, wherein the managed object metric is based on one or more runtime characteristics of a managed application that performs runtime calls to the one or more managed objects;
- when the ratio is greater than the threshold, initiating the full garbage collection operation including at least:
- suspending the managed application that performs runtime calls to one or more managed objects stored in the heap during the full garbage collection operation;
- determining whether each of the one or more managed objects in each generation of the heap is a reachable object or an unreachable object;
- adding the unreachable objects in each generation to a finalizer list;
- consolidating one or more managed objects that remain in the heap into a contiguous portion of the heap during the full garbage collection operation, including moving the reachable objects to a contiguous portion of the heap;
- performing the full garbage collection at least partially based on the finalizer list;
- and
- restarting execution of the managed application;
- and
- when the ratio is not greater than the threshold, performing the ephemeral garbage collection operation without suspending the managed application.
8 more elements
A system, comprising:
- one or more processing devices;
- and
- one or more processor-readable storage media bearing one or more instructions that, when executed by the one or more processing devices, perform operations including:
- determining whether a ratio of a total resource usage metric to a managed object metric is greater than a threshold, wherein the managed object metric is based on one or more runtime characteristics of a managed application that performs runtime calls to one or more objects stored within a heap stored within a memory of a device;
- determining whether to initiate a full garbage collection operation or an ephemeral garbage collection operation on the heap stored within the memory of the device based at least partially on the determination whether the ratio of the total resource usage metric to the managed object metric is greater than the threshold;
- when the ratio is greater than the threshold, initiating the full garbage collection operation including at least:
- suspending the managed application that performs runtime calls to one or more managed objects stored in the heap during the full garbage collection operation;
- determining whether each of the one or more managed objects in each generation of the heap is a reachable object or an unreachable object;
- adding the unreachable objects in each generation to a finalizer list;
- consolidating one or more managed objects that remain in the heap into a contiguous portion of the heap during the full garbage collection operation, including moving the reachable objects to a contiguous portion of the heap;
- performing the full garbage collection at least partially based on the finalizer list;
- and
- restarting execution of the managed application;
- and
- when the ratio is not greater than the threshold, then:
- determining whether the total resource usage metric is greater than a maximum total resource usage;
- when the total resource usage metric is greater than the maximum total resource usage, initiating the full garbage collection operation;
- and
- when the total resource usage metric is not greater than the maximum total resource usage, performing the ephemeral garbage collection operation without suspending the managed application.
16 more elements
Dependencies are inferred from the claim text.