# US 10,120,796 B2 · Memory allocation for long-lived objects

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

- Number: US 10,120,796 B2
- Document ID: US10120796B2
- Status: Granted
- Kind: B2
- Application number: 13/616,701
- Filed: 2012-09-14
- Published: 2014-03-20
- Granted: 2018-11-06
- Earliest claimed: 2012-09-14
- Assignees: Sap SE
- Applicants: Martin Moser
- Inventors: Martin Moser
- Web page: https://patentgrep.com/patent/US10120796B2

## CPC

- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 12/0276: {Generational garbage collection}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Managing memory allocations in a computer system may include tagging a class of data structures with a tag that identities a longer memory-allocation time for objects that correspond to the class. In response to a memory-allocation request for an object, whether or not the object is associated with the tag can be determined through the class. If the object is not associated with the tag, memory can be allocated for the object from a first memory-allocation area that corresponds to a shorter memory-allocation time, and if the object is associated with the tag, memory can be allocated for the object from a second memory-allocation area that corresponds to the longer memory-allocation time.

## Claims

### Claim 1

A method of managing memory allocations in a computer system, the method comprising:
tagging a class of data structures with a tag that identifies a longer memory-allocation time for objects that correspond to the class, the tag being represented by a programming structure for the tag in a class definition file for the class;
receiving a memory-allocation request for an object in a runtime operation for managing memory allocations, wherein the object corresponds to the class;
accessing the class definition file in the runtime operation, the tag being associated with the class in the runtime operation through the programming structure for the tag;
determining whether or not the object is associated with the tag through the class;
if the object is not associated with the tag, allocating memory for the object from a first memory-allocation area that corresponds to a shorter memory-allocation time; and
if the object is associated with the tag, allocating memory for the object from a second memory-allocation area that corresponds to the longer memory-allocation time.

### Claim 2 (depends on 1)

The method of claim 1, wherein the object instantiates the class in an object-oriented programming system.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
using a portion of an object header corresponding to the class to represent the tag; and
determining that the object is associated with the tag by identifying that the object instantiates the class and inspecting the portion of the object header where the tag is represented.

### Claim 4 (depends on 1)

The method of claim 1, wherein the programming structure for the tag corresponds a marker interface;
tagging the class includes associating the marker interface with the class; and
determining whether or not the object is associated with the tag includes determining tether or not the object supports the marker interface through the class.

### Claim 5 (depends on 1)

The method of claim 1, wherein the programming structure for the tag corresponds a marker annotation;
tagging the class includes associating the marker annotation with the class; and
determining whether or not the object is associated with the tag includes determining whether or not the object identifies the marker annotation through the class.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
performing first memory-management operations in the first memory-allocation area, the first memory-management operations being carried out at intervals corresponding to a first time increment;
performing second memory-management operations in the second memory-allocation area, the second memory-management operations being carried out at intervals corresponding to a second time increment, the second time increment being greater than the first time increment; and
transferring a memory allocation for a first object from the first memory-allocation area to the second memory-allocation area if a corresponding memory-allocation time for the first object reaches a threshold value for memory-allocation time in the first memory-allocation area.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
performing first memory-management operations in the first memory-allocation area, the first memory-management operations including operations that copy first-memory-allocation-area survivors from a first portion of the first memory-allocation area to a second portion of the first memory-allocation area;
performing second memory-management operations in the second memory-allocation area, the second memory-management operations including operations that mark second- memory-allocation-area survivors and copy the second-memory-allocation-area survivors into available portions of the second memory-allocation area; and
transferring a memory allocation for a first object from the first memory-allocation area to the second memory-allocation area if a corresponding memory-allocation time for the first object reaches a threshold value for memory-allocation time in the first memory-allocation area.

### Claim 8 (depends on 1)

The method of claim 1, wherein the class identifies objects that are expected to persist for a threshold number of computing cycles.

### Claim 9

A non-transitory computer-readable medium that stores a computer program for managing memory allocations in a computer system, the computer program including instructions that, when executed by at least one computer, cause the at least one computer to perform operations comprising:
tagging a class of data structures with a tag that identifies a longer memory-allocation time for objects that correspond to the class, the tag being represented by a programming structure for the tag in a class definition file for the class;
receiving a memory-allocation request for an object in a runtime operation for managing memory allocations, wherein the object corresponds to the class;
accessing the class definition file in the runtime operation, the tag being associated with the class in the runtime operation through the programming structure for the tag;
determining whether or not the object is associated with the tag through the class;
if the object is not associated with the tag, allocating memory for the object from a first memory-allocation area that corresponds to a shorter memory-allocation time; and
if the object is associated with the tag, allocating memory for the object from a second memory-allocation area that corresponds to the longer memory-allocation time.

### Claim 10 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the object instantiates the class in an object-oriented programming system.

### Claim 11 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the computer program further includes instructions that, when executed by the at least one computer, cause the at least one computer to perform operations comprising:
using a portion of an object header corresponding to the class to represent the tag; and
determining that the object is associated with the tag by identifying that the object instantiates the class and inspecting the portion of the object header where the tag is represented.

### Claim 12 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the programming structure for the tag corresponds a marker interface;
tagging the class includes associating the marker interface with the class; and
determining whether or not the object is associated with the tag includes determining whether or not the object supports the marker interface through the class.

### Claim 13 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the programming structure for the tag corresponds a marker annotation;
tagging the class includes associating the marker annotation with the class; and
determining whether or not the object is associated with the tag includes determining whether or not the object identifies the marker annotation through the class.

### Claim 14 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the computer program further includes instructions that, when executed by the at least one computer, cause the at least one computer to perform operations comprising:
performing first memory-management operations in the first memory-allocation area, the first memory-management operations being carried out at intervals corresponding to a first time increment;
performing second memory-management operations in the second memory-allocation area, the second memory-management operations being carried out at intervals corresponding to a second time increment, the second time increment being greater than the first time increment; and
transferring a memory allocation for a first object from the first memory-allocation area to the second memory-allocation area if a corresponding memory-allocation time for the first object reaches a threshold value for memory-allocation time in the first memory-allocation area.

### Claim 15 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the computer program further includes instructions that, when executed by the at least one computer, cause the computer to perform operations comprising:
performing first memory-management operations in the first memory-allocation area, the first memory-management operations including operations that copy first-memory-allocation-area survivors from a first portion of the first memory-allocation area to a second portion of the first memory-allocation area;
performing second memory-management operations in the second memory-allocation area, the second memory-management operations including operations that mark second-memory-allocation-area survivors and copy the second-memory-allocation-area survivors into available portions of the second memory-allocation area; and
transferring a memory allocation for a first object from the first memory-allocation area to the second memory-allocation area if a corresponding memory-allocation time for the first object reaches a threshold value for memory-allocation time in the first memory-allocation area.

### Claim 16 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the class identifies objects that are expected to persist for a threshold number of computing cycles.

### Claim 17

An apparatus to manage memory allocations in a computer system, the apparatus comprising at least one computer configured to perform operations for computer-executable modules including:
a class-tagging module that tags a class of data structures with a tag that identifies a longer memory-allocation time for objects that correspond to the class, the tag being represented by a programming structure for the tag in a class definition file for the class;
an object-tagging module that:
receives a memory-allocation request for an object in a runtime operation for managing memory allocations, wherein the object corresponds to the class;
determines whether or not the object is associated with the tag through the class, the class definition file being accessed in the runtime operation, and the tag being associated with the class in the runtime operation through the programming structure for the tag; and
a memory-allocation module that performs operations including:
if the object is not associated with the tag, allocating memory for the object from a first memory-allocation area that corresponds to a shorter memory-allocation time; and
if the object is associated with the tag, allocating memory for the object from a second memory-allocation area that corresponds to the longer memory-allocation time.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the object instantiates the class in an object-oriented programming system.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein the class-tagging module uses a portion of an object header corresponding to the class to represent the tag; and
the object-tagging module determines that the object is associated with the tag by identifying that the object instantiates the class and inspecting the portion of the object header where the tag is represented.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein the programming structure for the tag corresponds a marker interface;
tagging the class includes associating the marker interface with the class; and
determining whether or not the object is associated with the tag includes determining whether or not the object supports the marker interface through the class.

### Claim 21 (depends on 17)

The apparatus of claim 17, wherein the programming structure for the tag corresponds a marker annotation;
tagging the class includes associating the marker annotation with the class; and
determining whether or not the object is associated with the tag includes determining whether or not the object identifies the marker annotation through the class.

### Claim 22 (depends on 17)

The apparatus of claim 17, wherein the computer-executable modules further include a memory-management module that performs operations including:
performing first memory-management operations in the first memory-allocation area, the first memory-management operations being carried out at intervals corresponding to a first time increment;
performing second memory-management operations in the second memory-allocation area, the second memory-management operations being carried out at intervals corresponding to a second time increment, the second time increment being greater than the first time increment; and
transferring a memory allocation for a first object from the first memory-allocation area to the second memory-allocation area if a corresponding memory-allocation time for the first object reaches a threshold value for memory-allocation time in the first memory-allocation area.

### Claim 23 (depends on 17)

The apparatus of claim 17, wherein the computer-executable modules further include a memory-management module that performs operations including:
performing first memory-management operations in the first memory-allocation area, the first memory-management operations including operations that copy first-memory-allocation-area survivors from a first portion of the first memory-allocation area to a second portion of the first memory-allocation area;
performing second memory-management operations in the second memory-allocation area, the second memory-management operations including operations that mark second-memory-allocation-area survivors and copy the second-memory-allocation-area survivors into available portions of the second memory-allocation area; and
transferring a memory allocation for a first object from the first memory-allocation area to the second memory-allocation area if a corresponding memory-allocation time for the first object reaches a threshold value for memory-allocation time in the first memory-allocation area.

### Claim 24 (depends on 17)

The apparatus of claim 17, wherein the class identifies objects that are expected to persist for a threshold number of computing cycles.
