Deferred destruction for efficient resource reclamation
AssigneeOptumSoft, Inc.
InventorDavid R. Cheriton
Life of this patent
Estimating the term…
Abstract
Memory reclamation includes executing a process that has a plurality of objects, the objects being accessible via a plurality of references, at least some of the plurality of references being transient references, at least some of the plurality of references being persistent references; reaching a reclamation point at which a process state has no transient references, or has transient references only at known locations; and at the reclamation point, destructing objects that have no persistent references and no transient references.
Claims16
A method, comprising:
- executing a process that has a plurality of objects, wherein prior to reaching a reclamation point:
- at least one object among the plurality of objects has a persistent reference and a transient reference;
- the persistent reference is used in determining a reference count of the object;
- and
- the transient reference is not used in determining the reference count of the object;
- maintaining a destruct list, comprising:
- determining whether a persistent reference count of an object on the destruct list is non-zero;
- and
- in response to a determination that the persistent reference count of the object on the destruct list is non-zero, deleting the object from the destruct list;
- reaching a reclamation point where an object among the plurality of objects either has no transient references, or has one or more transient references only at one or more known locations, wherein reaching the reclamation point is triggered in response to a memory reserve pool being used by the process, and wherein reaching the reclamation point where the object among the plurality of objects either has no transient references, or has one or more transient references only at one or more known locations comprises:
- determining that memory usage of the process is equal to or exceeds a threshold;
- and
- determining that the reclamation point has been reached;
- upon reaching the reclamation point, processing, using the destruct list, objects on the destruct list, comprising:
- checking whether there is a transient reference to an object on the destruct list at a known location;
- and
- in response to a determination that there is no transient reference to the object at the known location:
- determining whether the persistent reference count of the object at the known location is non-zero;
- and
- in response to a determination that the persistent reference count of the object at the known location is non-zero, omitting to destruct the object on the destruct list;
- and
- in response to setting an attribute of at least one object of the plurality of objects to be terminated, triggering a deletion of the at least one object from a collection.
A system, comprising:
- one or more memories to store a plurality of objects of a process;
- and
- one or more hardware processors coupled to the one or more memories, to:
- execute the process that has the plurality of objects, wherein prior to reaching a reclamation point:
- at least one object among the plurality of objects has a persistent reference and a transient reference;
- the persistent reference is used in determining a reference count of the object;
- and
- the transient reference is not used in determining the reference count of the object;
- maintain a destruct list, comprising to:
- determine whether a persistent reference count of an object on the destruct list is non-zero;
- and
- in response to a determination that the persistent reference count of the object on the destruct list is non-zero, delete the object from the destruct list;
- reach a reclamation point where an object among the plurality of objects either has no transient references, or has one or more transient references only at one or more known locations, wherein reaching the reclamation point is triggered in response to a memory reserve pool being used by the process, and wherein reaching the reclamation point where the object among the plurality of objects either has no transient references, or has one or more transient references only at one or more known locations comprises to:
- determine that memory usage of the process is equal to or exceeds a threshold;
- and
- determine that the reclamation point has been reached;
- and
- upon reaching the reclamation point, process, using the destruct list, objects on the destruct list, comprising to:
- check whether there is a transient reference to an object on the destruct list at a known location;
- and
- in response to a determination that there is no transient reference to the object at the known location:
- determining whether the persistent reference count of the object at the known location is non-zero;
- and
- in response to a determination that the persistent reference count of the object at the known location is non-zero, omit to destructing the object on the destruct list;
- and
- in response to setting an attribute of at least one object of the plurality of objects to be terminated, trigger a deletion of the at least one object from a collection.
A computer program product, the computer program product being embodied in a tangible non-transitory computer readable storage medium and comprising computer instructions for:
- executing a process that has a plurality of objects, wherein prior to reaching a reclamation point:
- at least one object among the plurality of objects has a persistent reference and a transient reference;
- the persistent reference is used in determining a reference count of the object;
- and
- the transient reference is not used in determining the reference count of the object;
- maintaining a destruct list, comprising:
- determining whether a persistent reference count of an object on the destruct list is non-zero;
- and
- in response to a determination that the persistent reference count of the object on the destruct list is non-zero, deleting the object from the destruct list;
- reaching a reclamation point where an object among the plurality of objects either has no transient references, or has one or more transient references only at one or more known locations, wherein reaching the reclamation point is triggered in response to a memory reserve pool being used by the process, and wherein reaching the reclamation point where the object among the plurality of objects either has no transient references, or has one or more transient references only at one or more known locations comprises:
- determining that memory usage of the process is equal to or exceeds a threshold;
- and
- determining that the reclamation point has been reached;
- and
- upon reaching the reclamation point, processing, using the destruct list, objects on the destruct list, comprising:
- checking whether there is a transient reference to an object on the destruct list at a known location;
- and
- in response to a determination that there is no transient reference to the object at the known location:
- determining whether the persistent reference count of the object at the known location is non-zero;
- and
- in response to a determination that the persistent reference count of the object at the known location is non-zero, omitting to destruct the object on the destruct list;
- and
- in response to setting an attribute of at least one object of the plurality of objects to be terminated, triggering a deletion of the at least one object from a collection.
Dependencies are inferred from the claim text.