Patent ID: 6353838
Filing Date: 2002-03-05
Classification: G06F,Y10S

Abstract:
In a computer system that includes a processing unit, a system memory, and a plurality of program modules, wherein at least a portion of the system memory comprises a heap from which objects may be dynamically allocated, and wherein the plurality of program modules include one or more programs or functions dynamically allocating memory from the heap for one or more objects and a main garbage collector that typically examines the entire heap when periodically attempting to reclaim memory dynamically allocated by the one or more programs or functions for the one or more objects, a method of reclaiming at least some dynamically allocated memory associated with the one or more objects immediately after the function or program that allocated the one or more objects either terminates or exits rather than waiting for the main garbag collector, the method comprising:an act of, for an object that has been allocated, storing additional information within the object itself that includes a marker indicating whether the object is local to the function or program that dynamically allocated the object in the first instance; an act of, immediately after the function or program that initially dynamically allocated the object either terminates or exits and prior to when the main garbage collector attempts to reclaim memory, examining the additional information for at least one object allocated by the function or program to determine if the at least one object has a marker indicating that it is local to the function or program; if the at least one object is local to the function or program, then performing a step for reclaiming the dynamically allocated memory associated with the at least one object; and if the at least one object is not local to the function or program, then performing a step for deferring to a later time any further attempt to reclaim the dynamically allocated memory associated with the at least one object.