# US 10,372,601 B2 · Managing memory in a computer system

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

- Number: US 10,372,601 B2
- Document ID: US10372601B2
- Status: Granted
- Kind: B2
- Application number: 16/002,087
- Filed: 2018-06-07
- Published: 2018-10-04
- Granted: 2019-08-06
- Earliest claimed: 2012-05-15
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Edward J. Slattery
- Web page: https://patentgrep.com/patent/US10372601B2

## CPC

- G06F 12/00: Accessing, addressing or allocating within memory systems or architectures (digital input from, or digital output to record carriers, e.g. to disk storage units, G06F3/06)
- G06F 12/023: {Free address space management}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 12/0269: {Incremental or concurrent garbage collection, e.g. in real-time systems (G06F12/0261 takes precedence)}
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 16/901: Indexing; Data structures therefor; Storage structures (for retrieval from the web G06F16/951)
- G06F 2212/1044: Space efficiency improvement
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, computer program products, and systems for managing memory in a computer system in which memory locations in use at any given time are represented as a set of memory objects in a first object graph. The first object graph includes a system root object associated by references to each of the memory objects. A method includes creating a second root object for the memory to form a second object graph for the memory. The method also includes, in response to the dereferencing of a first object from the first object graph, associating the dereferenced first object with the second object graph so that the second object graph includes at least one dereferenced object.

## Claims

### Claim 1

A computer program product comprising a computer readable storage medium having program code embodied therewith, wherein the computer readable storage medium is not a transitory signal per se, the program code executable by a processor to cause the processor to perform a method comprising:
identifying one or more candidate objects in a dereferenced object graph, the dereferenced object graph including a set of objects that were dereferenced from a system root object graph, the one or more candidate objects being connected objects in the dereferenced object graph;
extracting dead object data from the one or more candidate objects;
removing, after extracting the dead object data from the one or more candidate objects, the one or more candidate objects from memory;
storing the extracted dead object data in the dereferenced object graph; and
repairing the dereferenced object graph.

### Claim 2 (depends on 1)

The computer program product of claim 1, wherein the identifying one or more candidate objects in the dereferenced object graph comprises:
traversing the dereferenced object graph to identify one or more dereferenced objects in the dereferenced object graph that are marked as live,
wherein the one or more candidate objects include objects in the dereferenced object graph that are not marked as live.

### Claim 3 (depends on 2)

The computer program product of claim 2, wherein the method performed by the processor further comprises:
identifying metadata objects associated with the one or more live dereferenced objects;
marking the metadata objects as live; and
returning, after removing the one or more candidate objects from memory, memory allocations of the one or more candidate objects to a heap.

### Claim 4 (depends on 3)

The computer program product of claim 3, wherein the candidate objects do not include metadata objects, and wherein the metadata objects include dead information objects and field definition objects.

### Claim 5 (depends on 1)

The computer program product of claim 1, wherein the dead object data for a candidate object includes an object identifier that identifies the candidate object, an identification of a parent object of the candidate object, and referencing field data that identifies a field in the parent object that referenced the candidate object.

### Claim 6 (depends on 5)

The computer program product of claim 5, wherein the parent object of the candidate object is an object in the system root object graph that indirectly references the candidate object via one or more dead objects.

### Claim 7 (depends on 1)

The computer program product of claim 1, wherein the repairing the dereferenced object graph includes removing redundant metadata objects from the dereferenced object graph.

### Claim 8 (depends on 1)

The computer program product of claim 1, wherein the method performed by the processor further comprises:
providing, by a memory manager, memory allocations from a first heap and a second heap, the first heap including storage for connected objects, the second heap including storage for a dead root object and metadata objects; and
creating, in response to dereferencing an object in the first heap, a corresponding set of metadata objects in the second heap, the corresponding set of metadata objects including a cross-heap reference to the dereferenced object in the first heap.

### Claim 9 (depends on 1)

The computer program product of claim 1, wherein the method performed by the processor further comprises:
marking one or more connected objects in the system root object graph as live, wherein the one or more connected objects represent memory locations in use by a program at a given time;
creating a dead root object so as to form the dereferenced object graph; and
in response to a dereferencing of a first object from the system root object graph, associating the dereferenced first object with the dereferenced object graph so that the dereferenced object graph comprises one or more dereferenced objects.

### Claim 10 (depends on 1)

The computer program product of claim 1, wherein storing the extracted dead object data in the dereferenced object graph includes replacing the one or more candidate objects in the dereferenced object graph with associated dead object data.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein the system root object graph is associated with an application, and wherein the method performed by the processor further comprises:
identifying, using the dead object data, one or more processes that created the dereferenced objects, the one or more processes being part of the application;
reconstructing the system root object graph using the dead object data at a selected point in the associated processing of the application; and
modifying the application to improve memory usage of the processes.
