# US 2002/0055941 A1 · Computer system with two heaps in contiguous storage

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

- Number: US 2002/0055941 A1
- Document ID: US20020055941A1
- Status: Published application
- Kind: A1
- Application number: 09/928,563
- Filed: 2001-08-13
- Published: 2002-05-09
- Earliest claimed: 2000-11-06
- Assignees: International Business Machines Corporation
- Inventors: Elliot Karl Kolodner; Ethan Lewis; Susan Patricia Paice; Samuel David Borman
- Web page: https://patentgrep.com/patent/US20020055941A1

## CPC

- G06F 3/0688: {Non-volatile semiconductor memory arrays}
- G06F 12/023: {Free address space management}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- Y10S 707/99957: Garbage collection
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A computer system provides an object-based environment. The computer system includes storage. A contiguous linear portion of the storage is logically divided into first and second heaps located at opposite ends of the linear portion of storage. Any gap between the two heaps represents an unallocated region of storage. The system permits references from objects on the first heap to objects on the second heap and vice versa. A garbage collector operates across both heaps to remove objects that are no longer live. Means are provided for expanding the first and second heaps into the unallocated region. The first heap is expanded according to a first expansion policy, and the second heap is expanded according to a second expansion policy.

## Claims

### Claim 1

A computer system providing an object-based environment, said computer system including storage, a contiguous linear portion of which is logically divided into first and second heaps located at opposite ends of the storage portion, with any gap between the two heaps representing an unallocated region of storage, wherein references are permitted from objects on the first heap to objects on the second heap and vice versa, said system comprising:
a garbage collector for operating across both heaps to remove objects that are no longer live;
means for expanding the first heap into said unallocated region according to a first expansion policy; and
means for expanding the second heap into said unallocated region according to a second expansion policy.

### Claim 2 (depends on 1)

The computer system of claim 1, wherein said computer system supports a transaction processing environment, and said first heap is used for storing objects that are deleted at the end of the current transaction, and said second heap is used for storing objects that persist from one transaction to another.

### Claim 3 (depends on 2)

The computer system of claim 2, wherein the first heap is reset to the same predetermined initial size at the start of each transaction.

### Claim 4 (depends on 3)

The computer system of claim 3, wherein the system returns an error condition if the second heap has expanded such that it is not possible to reset the first heap to its predetermined initial size.

### Claim 5 (depends on 3)

The computer system of claim 3, wherein a midpoint is defined halfway between the first heap and second heap, when they each have their initial size.

### Claim 6 (depends on 5)

The computer system of claim 5, wherein the first expansion policy is always to expand into said unallocated region in order to satisfy a storage request.

### Claim 7 (depends on 6)

The computer system of claim 6, in which the rate of expansion of the first heap into the unallocated region is slower once the first heap has passed said midpoint.

### Claim 8 (depends on 5)

The computer system of claim 5, wherein the second expansion policy is to expand into said unallocated region in order to satisfy a storage request until said midpoint is reached, whereupon said system preferentially performs a garbage collection to satisfy said request.

### Claim 9 (depends on 8)

The computer system of claim 8, wherein the second expansion policy further includes trying to shrink the first heap to allow room to expand said second heap in order to satisfy a storage request.

### Claim 10 (depends on 1)

The computer system of claim 1, wherein said garbage collector performs a compact operation after a garbage collection of the first and second heaps, said compact operation being performed in response to a first set of criteria relevant to the first heap, and a second set of criteria relevant to the second heap.

### Claim 11 (depends on 10)

The computer system of claim 10, where said second set of criteria are more sensitive to fragementation than the first set of criteria.

### Claim 12 (depends on 10)

The computer system of claim 10, further including means for shrinking the first and second heaps after compaction, and returning released storage to said unallocated region.

### Claim 13 (depends on 1)

The computer system of claim 1, further including a bit array, having one bit for each possible object location in said portion of storage, said bit indicating whether or not there is an object currently stored at the corresponding object location.

### Claim 14

A method of operating a computer system providing an object-based environment, said computer system including storage, a contiguous linear portion of which is logically divided into first and second heaps located at opposite ends of the storage portion, with any gap between the two heaps representing an unallocated region of storage, wherein references are permitted from objects on the first heap to objects on the second heap and vice versa, said method comprising the steps of:
operating a garbage collector across both heaps to remove objects that are no longer live;
expanding the first heap into said unallocated region according to a first expansion policy; and
for expanding the second heap into said unallocated region according to a second expansion policy.

### Claim 15 (depends on 14)

The method of claim 14, wherein said computer system supports a transaction processing environment, and said first heap is used for storing objects that are deleted at the end of the current transaction, and said second heap is used for storing objects that persist from one transaction to another.

### Claim 16 (depends on 15)

The method of claim 15, wherein the first heap is reset to the same predetermined initial size at the start of each transaction.

### Claim 17 (depends on 16)

The method of claim 16, wherein the system returns an error condition if the second heap has expanded such that it is not possible to reset the first heap to its predetermined initial size.

### Claim 18 (depends on 16)

The method of claim 16, wherein a midpoint is defined halfway between the first heap and second heap, when they each have their initial size.

### Claim 19 (depends on 18)

The method of claim 18, wherein the first expansion policy is always to expand into said unallocated region in order to satisfy a storage request.

### Claim 20 (depends on 19)

The method of claim 19, in which the rate of expansion of the first heap into the unallocated region is slower once the first heap has passed said midpoint.

### Claim 21 (depends on 18)

The method of claim 18, wherein the second expansion policy is to expand into said unallocated region in order to satisfy a storage request until said midpoint is reached, whereupon said system preferentially performs a garbage collection to satisfy said request.

### Claim 22 (depends on 21)

The method of claim 21, wherein the second expansion policy further includes trying to shrink the first heap to allow room to expand said second heap in order to satisfy a storage request.

### Claim 23 (depends on 14)

The method of claim 14, wherein said garbage collector performs a compact operation after a garbage collection of the first and second heaps, said compact operation being performed in response to a first set of criteria relevant to the first heap, and a second set of criteria relevant to the second heap.

### Claim 24 (depends on 23)

The method of claim 23, where said second set of criteria are more sensitive to fragementation than the first set of criteria.

### Claim 25 (depends on 23)

The method of claim 23, further including the step of shrinking the first and second heaps after compaction, and returning released storage to said unallocated region.

### Claim 26 (depends on 14)

The method of claim 14, further including the step of providing a bit array, having one bit for each possible object location in said portion of storage, said bit indicating whether or not there is an object currently stored at the corresponding object location.

### Claim 27

A computer program product comprising program instructions recorded on a storage medium readable by a computer system, said computer system providing an object-based environment and including storage, a contiguous linear portion of which is logically divided into first and second heaps located at opposite ends of the storage portion, with any gap between the two heaps representing an unallocated region of storage, wherein references are permitted from objects on the first heap to objects on the second heap and vice versa, said program instructions causing said computer system to perform the steps of:
operating a garbage collector across both heaps to remove objects that are no longer live;
expanding the first heap into said unallocated region according to a first expansion policy; and
for expanding the second heap into said unallocated region according to a second expansion policy.

### Claim 28 (depends on 27)

The computer program product of claim 27, wherein said computer system supports a transaction processing environment, and said first heap is used for storing objects that are deleted at the end of the current transaction, and said second heap is used for storing objects that persist from one transaction to another.

### Claim 29 (depends on 28)

The computer program product of claim 28, wherein the first heap is reset to the same predetermined initial size at the start of each transaction.

### Claim 30 (depends on 29)

The computer program product of claim 29, wherein the system returns an error condition if the second heap has expanded such that it is not possible to reset the first heap to its predetermined initial size.

### Claim 31 (depends on 29)

The computer program product of claim 29, wherein a midpoint is defined halfway between the first heap and second heap, when they each have their initial size.

### Claim 32 (depends on 31)

The computer program product of claim 31, wherein the first expansion policy is always to expand into said unallocated region in order to satisfy a storage request.

### Claim 33 (depends on 32)

The computer program product of claim 32, in which the rate of expansion of the first heap into the unallocated region is slower once the first heap has passed said midpoint.

### Claim 34 (depends on 31)

The computer program product of claim 31, wherein the second expansion policy is to expand into said unallocated region in order to satisfy a storage request until said midpoint is reached, whereupon said system preferentially performs a garbage collection to satisfy said request.

### Claim 35 (depends on 34)

The computer program product of claim 34, wherein the second expansion policy further includes trying to shrink the first heap to allow room to expand said second heap in order to satisfy a storage request.

### Claim 36 (depends on 27)

The computer program product of claim 27, wherein said garbage collector performs a compact operation after a garbage collection of the first and second heaps, said compact operation being performed in response to a first set of criteria relevant to the first heap, and a second set of criteria relevant to the second heap.

### Claim 37 (depends on 36)

The computer program product of claim 36, where said second set of criteria are more sensitive to fragementation than the first set of criteria.

### Claim 38 (depends on 36)

The computer program product of claim 36, wherein said program instructions further cause said computer system to perform the step of shrinking the first and second heaps after compaction, and returning released storage to said unallocated region.

### Claim 39 (depends on 27)

The computer program product of claim 27, wherein said program instructions further cause said computer system to perform the step of providing a bit array, having one bit for each possible object location in said portion of storage, said bit indicating whether or not there is an object currently stored at the corresponding object location.
