# US 2018/0024909 A1 · Monitoring growth of memory buffers in logging and dynamically adapting quantity and detail of logging

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

- Number: US 2018/0024909 A1
- Document ID: US20180024909A1
- Status: Published application
- Kind: A1
- Application number: 15/218,161
- Filed: 2016-07-25
- Published: 2018-01-25
- Earliest claimed: 2016-07-25
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Scott J. Broussard; Thangadurai Muthusamy; Amartey S. Pearson; Rejy V. Sasidharan
- Web page: https://patentgrep.com/patent/US20180024909A1

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- G06F 2201/865: Monitoring of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Computer implemented methods for monitoring growth of memory buffers in logging and dynamically adapting quantity and detail of logging. In one method, a computer determines whether an operation of a thread has a failure and whether the failure is severe and logs details from a pre-thread logging buffer. In another method, a computer calculates an increase in a log buffer size, reads from a configuration file a maximum allowed increase in the log buffer size, and returns logging details, in response to determining that the increase is more than the maximum allowed increase. In yet another method, a computer writes a log of a use case to a disk, calculates an actual size of the log in the database, and returns logging details, in response to determining that the actual size is more than the allowed size.

## Claims

### Claim 1

A method for monitoring growth of memory buffers in logging and dynamically adapting quantity and detail of logging, the method comprising:
starting, by a computer, a per-thread logging buffer, in response to determining that a thread starts an operation of a task;
determining, by the computer, whether the operation has a failure, in response to determining that the operation completes;
determining, by the computer, whether the failure is severe, in response to determining that the operation has the failure; and
logging, by the computer, details from the per-thread logging buffer, in response to determining that the failure is severe.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
in response to determining that the operation does not have the failure, logging, by the computer, the operation as successful, without logging the details from the per-thread logging buffer.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
in response to determining that the failure is not severe, logging, by the computer, the operation as successful, without logging the details from the per-thread logging buffer.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
calling, by the computer, a method of beginning the operation, in response to determining that the thread starts the operation of the task; and
calling, by the computer, a method of ending the operation, in response to determining that the thread exits the operation of the task.

### Claim 5 (depends on 1)

The method of claim 1, wherein the thread spawns one or more child threads, wherein execution of a use case completes when the thread and the one or more child threads complete operations, wherein the thread and the child threads share the per-thread logging buffer.

### Claim 6 (depends on 1)

The method of claim 1, wherein cumulative memory buffer usage for multiple use cases is measured for logging in the per-thread logging buffer, wherein each of the multiple use cases is tagged in the logging.

### Claim 7

A method for monitoring growth of memory buffers in logging and dynamically adapting quantity and detail of logging, the method comprising:
calling, by a computer, a log buffer to get buffered data, in response to determining that a use case completes;
calculating, by the computer, an increase in a size of the log buffer;
retrieving, by the computer, from a configuration file, a maximum allowed increase in the size of the log buffer;
determining, by the computer, whether the increase is more than the maximum allowed increase; and
returning, by the computer, logging details, in response to determining that the increase is more than the maximum allowed increase.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
in response to determining that the increase is not more than the maximum allowed increase, returning, by the computer, without the logging details.

### Claim 9 (depends on 7)

The method of claim 7, further comprising:
running, by the computer, multiple use cases;
measuring, by the computer, a size of logging for every use case; and
storing, by the computer, measured values of sizes of logging in a persistent data store as a reference; and
wherein the increase in the size of the log buffer is determined based on the reference.

### Claim 10 (depends on 7)

The method of claim 7, wherein the increase in the size of the log buffer and the maximum allowed increase are in term of percentage.

### Claim 11 (depends on 7)

The method of claim 7, wherein the configuration file is defined in a post build verification program.

### Claim 12 (depends on 7)

The method of claim 7, wherein the computer flushes contents in the log buffer to a temporary disk file when the log buffer is full, wherein the computer calculates a total consumed memory for logging by summing the contents in the log buffer and measuring a size of the temporary disk file.

### Claim 13

A method for monitoring growth of memory buffers in logging and dynamically adapting quantity and detail of logging, the method comprising:
writing, by a computer, a log of a use case to a disk, in response to determining that the use case completes;
calculating, by the computer, an actual size of the log on the disk;
determining, by the computer, whether the actual size is more than an allowed size; and
returning, by the computer, logging details, in response to determining that the actual size is more than the allowed size.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
in response to determining that the actual size is not more than the allowed size, returning, by the computer, without the logging details.

### Claim 15 (depends on 13)

The method of claim 13, wherein the allowed size is defined in a configuration file.
