# US 2012/0254266 A1 · Numa-aware garbage collection

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2012/0254266 A1
- Document ID: US20120254266A1
- Status: Published application
- Kind: A1
- Application number: 13/077,619
- Filed: 2011-03-31
- Published: 2012-10-04
- Earliest claimed: 2011-03-31
- Assignees: Oracle International Corporation
- Inventors: Antonios Printezis; Igor Veresov; Paul Henry Hohensee; John Coomes
- Web page: https://patentgrep.com/patent/US20120254266A1

## CPC

- G06F 12/0276: {Generational garbage collection}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 2212/2542: Non-uniform memory access [NUMA] architecture
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems for garbage collection are described. In some embodiments, Garbage collector threads may maximize local accesses and minimize remote access by copying Young objects and Old objects differently. When copying a Young object, a garbage collector thread may determine the lgroup of the pool that contains the object and copy the object to a pool of the same lgroup. The garbage collector thread may spread Old objects among lgroups by copying Old objects to pools of the same lgroup as the respective garbage collector thread. Additional methods and systems are disclosed.

## Claims

### Claim 1

A method comprising:
accessing a young object from a source region of a first pool by a garbage collector thread, the first pool associated with a particular lgroup among a plurality of lgroups, a processing unit and a memory in communication with and local to the particular processing unit being grouped in the particular lgroup, the first pool deployed within heap space of the particular memory;
allocating a space for the young object in a survivor region associated with a second pool, the second pool associated with the particular lgroup; and
copying the young object to the allocated space in the survivor region associated with the second pool.

### Claim 2 (depends on 1)

The method of claim 1, wherein allocating the space comprises:
allocating the space for the young object in a promotion local allocation buffer (PLAB) being within the survivor region associated with the second pool, the young object being within a thread local allocation buffer (TLAB) of the source region.

### Claim 3 (depends on 2)

The method of claim 2, wherein the particular PLAB is among a plurality of PLABs associated with the particular lgroup.

### Claim 4 (depends on 2)

The method of claim 2, wherein only the garbage collector thread is exclusively associated with the PLAB and further comprising:
exclusively associating the garbage collector thread with the PLAB such that objects cannot be copied by other threads into the PLAB exclusively associated with the garbage collector thread.

### Claim 5 (depends on 1)

The method of claim 1, wherein the garbage collector thread is executing on the particular processing unit.

### Claim 6 (depends on 1)

The method of claim 1, wherein the garbage collector thread is executing on a different processing unit, the different processing unit associated with a same lgroup of the plurality of lgroups.

### Claim 7 (depends on 1)

The method of claim 1, wherein an execution thread that created the young object is executing on the particular processing unit.

### Claim 8 (depends on 1)

The method of claim 1, wherein the garbage collector thread saves a plurality of objects that are to survive a garbage collection cycle in the survivor region, and the young object is an object that was created for use with an execution thread.

### Claim 9 (depends on 1)

The method of claim 1, wherein the source region is an allocation region used by an execution thread to reserve memory for most newly created objects, the young object being an object that has not been promoted to an old region, the survivor region being a region where objects have survived garbage collection in the allocation region, and the memory being local to the processing unit by meeting a data communication speed and throughput that remote memory does not meet.

### Claim 10 (depends on 1)

The method of claim 1, wherein the source region is a different survivor region than the survivor region in which the young object is copied.

### Claim 11

A method comprising:
accessing an object from a source region of a first pool by a, garbage collector thread, the first pool associated with a particular lgroup among a plurality of lgroups, a processing unit and a memory in communication with and local to the particular processing unit being grouped in the particular lgroup, the first pool deployed within heap space of the particular memory, the garbage collector thread associated with a second pool associated with a different lgroup among the plurality of lgroups;
allocating a space for the object in an old region associated with the second pool; and
copying the object to allocated space in the old region associated with the second pool.

### Claim 12 (depends on 11)

The method of claim 11, wherein allocating the space comprises:
allocating the space for the object in a promotion local allocation buffer (PLAB), the allocated space of the PLAB being within the old region associated with the second pool, the old region being a region to which objects are promoted from the allocation region and the survivor region.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
determining that a plurality of objects in the heap space are not evenly spread across the plurality of lgroups; and
selecting the second pool among a plurality of pools according to a round-robin lgroup order based on a determination that the plurality of objects are not evenly spread,
wherein allocation of the space for the object is based on selection of the second pool.

### Claim 14 (depends on 11)

The method of claim 11, wherein accessing the object comprises:
wherein accessing the object from the source region of the first pool when there are no further objects to process in the second pool during garbage collection in the second pool.

### Claim 15 (depends on 11)

The method of claim 11, wherein the old region is divided among the plurality of lgroups.

### Claim 16 (depends on 11)

The method of claim 11, wherein the garbage collector thread saves a plurality of objects that are to survive a garbage collection cycle in the survivor region, the old region is a region where objects have survived a number of garbage collection cycles, and the object was created for use with an execution thread.

### Claim 17 (depends on 11)

The method of claim 11, wherein the source region is an allocation region.

### Claim 18 (depends on 11)

The method of claim 11, wherein the source region is a survivor region.

### Claim 19 (depends on 11)

The method of claim 11, wherein the source region is a different old region than the old region in which the object is copied.

### Claim 20

A non-transitory machine-readable medium comprising instructions, which when executed by one or more processors, cause the one or more processors to perform the following operations:
access a young object from a source region of a first pool by a garbage collector thread, the first pool associated with a particular lgroup among a plurality of lgroups, a processing unit and a memory in communication with and local to the particular processing unit being grouped in the particular lgroup, the first pool deployed within heap space of the particular memory;
allocating a space for the young object in a survivor region associated with a second pool, the second pool associated with the same particular lgroup;
copying the young object to the allocated space in the survivor region associated with the second pool;
accessing the object from the survivor region of the second pool by a garbage collector thread, the garbage collector thread associated with a third pool associated with a different lgroup among the plurality of lgroups;
allocating a space for the object in an old region associated with the third pool; and
copying the object to allocated space in the old region associated with the third pool.
