摘要:
A garbage collector that reclaims memory space no longer needed by a mutator treats a generation of a dynamically allocated heap as being divided into “car” sections. For each car section, the collector maintains a remembered-set structure in which it keeps a record of the locations in the generation where the collector has previously found references to locations in that car section. The collector operates in increments in each of which it collects a respective collection set consisting of one or more of the generation's car sections. From the remembered sets associated with a collection set's car sections, it generates scratch-pad lists whose entries tell where locations identified by those remembered sets still contain references to collection-set locations. In situations in which the remembered sets are particularly large, the collector divides the operation of generating the scratch-pad lists into a plurality of collection intervals separated by mutator intervals. The collector bases its identification of reachable collection-set objects on the scratch-pad-list entries. By dividing the scratch-pad-list generation into multiple collection intervals, the collector can keep pause times low while employing relatively large collection sets.
摘要:
In a garbage collector that more efficiently places newly promoted objects into a generation managed by the train algorithm, a promotion train is established near the oldest train and the objects are placed therein. If some objects are referenced from existing trains in the generation those objects are placed into those trains, and if any such objects are referenced from several existing trains, the objects are placed at the end of the youngest referencing train. The promotion train may be a new train that is placed, or a existing train that is selected, between the oldest train and the youngest train at a position based on the amount of memory compared to the size of a collection set. In the case of multiple collector threads, multiple cars in a promotion train or multiple promotion trains may be formed.
摘要:
A copying-type garbage collector operates in multiple concurrent threads. Each thread evacuates potentially reachable objects from the from space to the to space in a depth-first manner: if a thread has evacuated an object containing references to any from-space objects, it evacuates all of that object's descendants before it evacuates any other reachable objects. To keep track of descendants that must be evacuated before non-descendants can be, the thread places objects containing references to non-evacuated objects into a linked list maintained by pointers that it installs in the from-space locations from which the objects on the list were evacuated. Additionally, it divides the to space into local-allocation buffers (“LABs”) to which respective threads exclusively evacuate objects, and each thread maintains a LAB stack representing all the LABs it has filled that still contain references to unevacuated from-space objects. When a thread has completed evacuating the descendants of evacuees in all of its LABs, it “steals” work from other threads. It may do so, for instance, by processing a reference in an object belonging to another thread's list, by transferring to its own list one or more objects from another thread's list, or by transferring to its own LAB stack one or more LABs from another thread's LAB stack.
摘要:
A technique for incrementally collecting enormous objects including scanning portions of the enormous objects on different collection steps. The scanning can be accomplished with a number of collection sets where the enormous object is re-linked and older cars remembered sets are updated on subsequent collection steps. Unscanned portions of the enormous object are scanned on subsequent collection cycles until the enormous object has been fully scanned. This incremental collection can be performed concurrently with collections of other generations and applications.
摘要:
A garbage collector operates in increments in which it collects a collection set consisting of one or more segments of a dynamically allocated heap. For each of those segments it maintains a remembered set of locations in which it has previously found references to objects in that associated segment. Each remembered set is stored in a plurality of remembered-set structures, each of which is associated with a separate one of a corresponding plurality of “stripes” into which at least a portion of the heap is divided. The garbage collector executes its remembered-set-updating operations in a plurality of concurrently executing threads, each of which claims exclusive access to a subset of the constituent remembered-set structures. By restricting its access only to that subset of the remembered-set structures that it has claimed, an individual thread is able to perform its portion of the updating operation without the need for synchronization with other threads.
摘要:
A garbage collector that operates in accordance with the train algorithm designates some cars as “special” cars into each of which at most a single object is allowed. When an object in a car being collected is referred to by a reference located in such a special car, the collector may depart from the conventional evacuation approach of placing the evacuated object into the train containing the reference referring to it. If the reference is located in an object referred to from a train younger than the train in which the reference is located, the referred-to object in the car being collected is not evacuated to the train that contains the reference to it. Instead, it is evacuated to the train from which the object containing that reference is referred to.
摘要:
A garbage collector collects a generation of a collected heap in accordance with the train algorithm. It employs remembered sets associated with respective car sections to keep track of references into the associated car sections. Each remembered set contains entries that identify respective regions in the generation that contain references into the associated car section. When the collector collects a car section, it reclaims the car section's objects for which there are no references, looking only in regions that the car section's remembered set specifies. Additionally, the collector treats the generation as divided into segments, for each of which it maintains a farthest-forward-car value that identifies which, among the car sections into which the respective segment contains a reference, is closest to collection. When the collector looks for references in a region that the remembered set specifies, it searches only that region's segments whose farthest-forward-car values identify car sections in the remembered set.
摘要:
A garbage collector collects a generation of a collected heap in accordance with the train algorithm. It employs remembered sets associated with respective car sections to keep track of references into the associated car sections. Each remembered set contains entries that identify respective regions in the generation that contain references into the associated car section. A limit is imposed on the number of entries in the remembered sets used to keep track of references to objects in certain car sections that contain only a single object each. An object in any such car section whose remembered set has more than a threshold number of entries is treated as reachable and relinked into a younger train without having the memory regions that those entries identify searched for valid references.
摘要:
Method and apparatus for barrier synchronization of threads, for example work-stealing threads. Embodiments may provide a consensus barrier synchronization mechanism that allows a “stop world” operation being performed by two or more worker threads configured to “steal” work from other threads to complete, even if one or more of the threads are not scheduled/started by the thread scheduler and thus do not rendezvous or “check in” at a consensus barrier in a timely manner. In embodiments, portions (subtasks) of the overall task which were assigned to the tardy thread may have been completed by other work-stealing threads, and one of the other threads may check in the tardy thread at the consensus barrier upon determining that the thread is dormant and does not have any more apportioned work to be performed. In one embodiment, the task being performed may be garbage collection for a process.
摘要:
In a computer system with a garbage-collected heap memory, a cache of modified reference locations is associated with each application thread. The cache comprises a plurality of reference cache entries that are encoded in one of a plurality of ways. Using a write barrier that operates during a store operation, each application thread records modified references in its associated reference cache. Only when an entry must be evicted to make room for new information or when the thread is suspended is further processing of the reference cache required.