Transparent garbage collection of resources
AssigneeGeodesic Systems, Incorporated
InventorMichael P. Spertus
Life of this patent
Estimating the term…
Loading patent…
AssigneeGeodesic Systems, Incorporated
InventorMichael P. Spertus
Estimating the term…
Techniques for transparently registering non-memory resources used by a program with a garbage collector so that the non-memory resources can be freed when the program is finished using them. The techniques automatically determine from the program that the execution will use a resource and then automatically modify the program's behavior so that the resource is registered. When the program is finished with the resource, it can be determined from the registry whether the resource must be freed. In one embodiment, the technique is employed in a garbage collector for doing resource garbage collection with legacy C and C++ programs. The garbage collector locates invocations that allocate such resources in the code and modifies the code so that when it is executed, the resources are registered. The techniques can also be used to ensure that finalizers associated with objects are executed before the object is freed. In this use, the invocation of the constructor for the object is modified so that the object and its finalizer are registered. When the object is no longer in use, the garbage collector uses the registry to obtain the object's finalizer, which it executes before it frees the object. Where the object represents a resource, execution of the finalizer will free the resource.
A method of releasing a resource used by an execution of a program in a computer system when the execution no longer requires the resource, the method comprising the steps performed by one or more other programs executing in the computer system of:
A method of executing a finalizer associated with an object when an execution of a program in a computer system no longer requires the object, the method comprising the steps performed by one or more other programs executing in the computer system of:
A method of automatically registering a resource used by an execution of
A method of automatically registering a finalizer associated with an object for execution when a program's execution in a computer system no longer requires the object,
A garbage collector that automatically executes a finalizer associated with an object,
Dependencies are inferred from the claim text.