Method for automatic system resource reclamation for object-oriented systems with real-time constraints
First Claim
1. A method for automatically effecting recovery of non-memory resources for use by a digital data processing system performing real-time operations, said digital data processing system including a limited amount of memory, wherein said digital data processing system performs said real-time operations by sending ones of a plurality of messages to selected ones of a plurality of objects, each of said plurality of objects being allocated when needed for a specific functionality of said real-time operations and wherein a portion of said limited amount of memory is assigned to each object as said object is allocated, select ones of said plurality of objects protecting non-memory resources, each of said plurality of objects being referenced when at least one other object contains a reference to that object and may send at least one of said plurality of messages to it, said method comprising the steps of:
- said system determining which of said plurality of objects are not referenced;
for each of said non-referenced objects said system determining whether said non-referenced object protects non-memory resources;
said system establishing a new reference to each of said non-referenced objects that protect non-memory resources; and
said system automatically effecting recovery of said non-memory resources by sending a predetermined one of said plurality of messages to each of said newly referenced objects that protect non-memory resources so that they may take action to make said non-memory resource available.
1 Assignment
0 Petitions
Accused Products
Abstract
In object-oriented systems, non-memory resources are both managed by objects and represented as objects. If an object managing or representing non-memory resources becomes unreferenced, the non-memory resources managed by that object are lost from the system. This invention provides, as a part of a garbage collection process that automatic recovers memory resources of unreferenced objects, a last-will method that is invoked for unreachable objects that have provided a method named "finalize." All unreachable objects that have a last will method are put on a list. A separate process is scheduled to run each last-will method on its object in the list. Objects that have become reachable as a consequence of the last-will method are preserved. The memory resources associated with objects that have remained unreachable after the execution of the last-will method are recovered. In this way both memory and non-memory resources are preserved for re-use.
150 Citations
11 Claims
-
1. A method for automatically effecting recovery of non-memory resources for use by a digital data processing system performing real-time operations, said digital data processing system including a limited amount of memory, wherein said digital data processing system performs said real-time operations by sending ones of a plurality of messages to selected ones of a plurality of objects, each of said plurality of objects being allocated when needed for a specific functionality of said real-time operations and wherein a portion of said limited amount of memory is assigned to each object as said object is allocated, select ones of said plurality of objects protecting non-memory resources, each of said plurality of objects being referenced when at least one other object contains a reference to that object and may send at least one of said plurality of messages to it, said method comprising the steps of:
-
said system determining which of said plurality of objects are not referenced; for each of said non-referenced objects said system determining whether said non-referenced object protects non-memory resources; said system establishing a new reference to each of said non-referenced objects that protect non-memory resources; and said system automatically effecting recovery of said non-memory resources by sending a predetermined one of said plurality of messages to each of said newly referenced objects that protect non-memory resources so that they may take action to make said non-memory resource available. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for automatically effecting recovery of non-memory resources for use by a digital data processing system performing real-time operations, said digital data processing system including a limited amount of memory, wherein said digital data processing system performs said real-time operations by sending ones of a plurality of messages to selected ones of a plurality of objects, said plurality of objects being allocated when needed for a specific functionality of said real-time operations and wherein a portion of said limited amount of memory is assigned to each object as said object is allocated, each of said plurality of objects being referenced when at least one other object may send at least one of said plurality of messages to that object, ones of said plurality of objects becoming unreferenced when that object'"'"'s functionality is no longer needed by the referencing object, said plurality of objects being stored in memory in a time-ordered sequence according to when they were allocated, said plurality of objects being grouped into a plurality of generations containing the same number of allocated objects, and said plurality of objects being either marked or unmarked, said method comprising the steps of:
-
selecting a contiguous one or more of said plurality of generations as a dynamically growing condemned region of said memory by selecting a first generation from said plurality of generations as a beginning of said condemned region of said memory, said condemned region of said memory including all generations created after said first generation; marking objects within said condemned region of said memory that are referenced from outside of said condemned region of memory; marking objects referenced by said marked objects within said condemned region of memory; making a list of all non-marked objects that protect non-memory resources within said condemned region of memory; determining a last generation of said plurality of generations as a end of said condemned region of memory; deallocating memory resources for use in defining new objects in said limited amount of memory associated with unmarked objects within said condemned region of memory except for said listed non-marked objects that protect non-memory resources, and at a subsequent time, sending a predefined one of said plurality of messages to each object in said list so that said previously non-referenced object may take action to make said non-memory resource available. - View Dependent Claims (9, 10, 11)
-
Specification