# US 10,372,604 B2 · Memory use for garbage collected computer environments

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

- Number: US 10,372,604 B2
- Document ID: US10372604B2
- Status: Granted
- Kind: B2
- Application number: 16/045,869
- Filed: 2018-07-26
- Published: 2018-12-13
- Granted: 2019-08-06
- Earliest claimed: 2013-07-18
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Norman Bobroff; Arun Iyengar; Peter Westerink
- Web page: https://patentgrep.com/patent/US10372604B2

## CPC

- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 3/0604: {Improving or facilitating administration, e.g. storage management}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0631: {by allocating resources to storage systems}
- G06F 3/0652: {Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket}
- G06F 3/0673: {Single storage device}
- G06F 2212/1044: Space efficiency improvement
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method, information processing system, and computer readable storage medium, periodically monitor, with a processing system, information related to an application's memory usage including a maximum heap memory size, an in use heap memory size, and a garbage collection activity level. Based on determining that the garbage collection activity level is below a first threshold, estimating an amount of memory that can be released from the application by reducing the maximum heap memory size. Based on determining that the estimated amount of memory that can be released from the application is above a second threshold, attempting to release memory from the application.

## Claims

### Claim 1

In a processing system including an application, a run-time system, and a heap memory used by the application, wherein unused memory in the heap memory is reclaimed by a garbage collector, a method for managing memory used by the application comprising:
periodically monitoring, with the processing system, information related to the application's memory usage including a maximum heap memory size, an in use heap memory size, and a garbage collection activity level;
based on determining that the garbage collection activity level is below a first threshold, estimating an amount of memory that can be released from the application by reducing the maximum heap memory size; and
based on determining that the estimated amount of memory that can be released from the application is above a second threshold, releasing memory from the application.

### Claim 2 (depends on 1)

The method of claim 1 in which the estimating an amount of memory that can be released from the application by reducing the maximum heap memory size comprises:
determining a difference between a committed heap memory size and the in use heap memory size.

### Claim 3 (depends on 1)

The method of claim 1 in which the estimating an amount of memory that can be released from the application by reducing the maximum heap memory size comprises:
performing a compacting garbage collection; and
determining a difference between a committed heap memory size and the in use heap memory size.

### Claim 4 (depends on 1)

The method of claim 1 in which releasing memory from the application further comprises:
performing a compacting garbage collection to instantiate a reduced value of maximum heap memory size.

### Claim 5 (depends on 1)

The method of claim 1 further comprising:
increasing the maximum heap memory size to allow the application to allocate more heap memory.

### Claim 6 (depends on 1)

The method of claim 1 in which the application comprises a Java virtual machine.

### Claim 7 (depends on 1)

The method of claim 1 in which the garbage collection activity level is determined based on at least one of:
a time since a garbage collection was performed on the heap memory;
a frequency of garbage collection performed on the heap memory; and
a time spent in garbage collection performed on the heap memory.

### Claim 8 (depends on 1)

The method of claim 1 in which the garbage collection activity level is determined based on at least one of:
a time since a compacting garbage collection was performed on the heap memory;
a frequency of compacting garbage collection performed on the heap memory; and
a time spent in at least one compacting garbage collection performed on the heap memory.

### Claim 9 (depends on 1)

The method of claim 1 in which the monitored garbage collection activity level is determined by normalizing a metric representing garbage collection overhead by an amount of processing time spent by the application not including garbage collection.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
providing a plurality of options to a user for specifying a level at which the processing system attempts to reduce memory used by the application.

### Claim 11

An information processing system comprising:
a memory comprising a heap memory for use by at least one application;
a processor communicatively coupled to the memory;
a garbage collector communicatively coupled to the processor and the memory, wherein unused memory in the heap memory is reclaimed by the garbage collector; and
wherein the processor, responsive to executing computer instructions, performs operations comprising:
periodically monitoring, with the processing system, information related to the application's memory usage including a maximum heap memory size, an in use heap memory size, and a garbage collection activity level;
based on determining that the garbage collection activity level is below a first threshold, estimating an amount of memory that can be released from the application by reducing the maximum heap memory size; and
based on determining that the estimated amount of memory that can be released from the application is above a second threshold, releasing memory from the application.

### Claim 12 (depends on 11)

The information processing system of claim 11, in which the estimating an amount of memory that can be released from the application by reducing the maximum heap memory size comprises:
determining a difference between a committed heap memory size and the in use heap memory size.

### Claim 13 (depends on 11)

The information processing system of claim 11, in which the estimating an amount of memory that can be released from the application by reducing the maximum heap memory size comprises:
performing a compacting garbage collection; and
determining a difference between a committed heap memory size and the in use heap memory size.

### Claim 14 (depends on 11)

The information processing system of claim 11, in which the releasing memory from the application further comprises:
performing a compacting garbage collection to instantiate a reduced value of maximum heap memory size.

### Claim 15 (depends on 11)

The information processing system of claim 11, wherein the processor, responsive to executing the computer instructions, performs operations comprising:
increasing the maximum heap memory size to allow the application to allocate more heap memory.

### Claim 16 (depends on 11)

The information processing system of claim 11, in which the application comprises a Java virtual machine.

### Claim 17 (depends on 11)

The information processing system of claim 11, further comprising a user input interface for receiving user input communications from a user of the information processing system, and a user output interface for providing output communications to the user, and wherein the processor, responsive to executing the computer instructions, performs operations comprising:
providing a plurality of options to the user, via the user output interface, for the user to select, via the user input interface, one of the plurality of options to specify a level at which the information processing system attempts to reduce memory used by the application, each option of the plurality of options being associated with a respective one pre-configured parameter setting of a plurality of different pre-configured parameter settings in the information processing system.

### Claim 18

A computer readable storage medium, comprising computer instructions which, responsive to being executed by a processor cause the processor to perform operations, the processor being in an information processing system comprised of a memory communicatively coupled to the processor, the memory comprising a heap memory, and a garbage collector communicatively coupled to the processor and the memory, wherein unused memory in the heap memory is reclaimed by the garbage collector, and wherein the processor, responsive to executing the computer instructions, performs operations comprising:
periodically monitoring, with the processing system, information related to the application's memory usage including a maximum heap memory size, an in use heap memory size, and a garbage collection activity level;
based on determining that the garbage collection activity level is below a first threshold, estimating an amount of memory that can be released from the application by reducing the maximum heap memory size; and
based on determining that the estimated amount of memory that can be released from the application is above a second threshold, releasing memory from the application.

### Claim 19 (depends on 18)

The computer readable storage medium of claim 18, in which the estimating an amount of memory that can be released from the application by reducing the maximum heap memory size comprises:
performing a compacting garbage collection; and
determining a difference between a committed heap memory size and the in use heap memory size.

### Claim 20 (depends on 18)

The computer readable storage medium of claim 18, in which the garbage collection activity level is determined based on at least one of:
a time since a compacting garbage collection was performed on the heap memory;
a frequency of compacting garbage collection performed on the heap memory; and
a time spent in at least one compacting garbage collection performed on the heap memory.
