Memory Manager Tracking Allocations via Trace Tables

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current data processing systems lack an efficient mechanism to identify and pinpoint the causes of memory leaks, particularly in complex multipurpose programs like operating system kernels, which can lead to reduced available memory and system performance issues.

Innovation Solution

A memory manager maintains a memory allocation table and trace table to track memory allocations and deallocations, using hash values and backtraces to identify clients or owners that may cause memory leaks, allowing for efficient detection and reporting of memory leak offenders.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the system monitors memory usage by multiple running applications, then memory availability is ensured, but the ability to identify memory leak causes deteriorates

Engineering Contradiction:
Improvememory availabilityVSAvoidmemory leak identification
Core Design Contradiction:
ReliabilityVSDifficulty of detecting and measuring

Solution Approach 1:

The patent segments the monitoring system into two distinct components: a memory allocation table that tracks current memory usage by applications, and a memory trace table that records the historical allocation paths and backtraces. This segmentation allows the system to maintain reliable memory availability monitoring while simultaneously enabling detailed memory leak identification through the trace table's historical data.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements preliminary action by maintaining backtrace information and allocation history in the trace table before memory leaks become critical problems. By recording the sequence of allocation calls and caller information in advance, the system enables rapid identification of memory leak sources without needing to perform complex analysis when memory issues arise.

Inventive Principle:
Principle #10Preliminary action

2Quantity of substance

If garbage collection is activated to increase free memory, then memory capacity is increased, but the root cause of memory leaks remains unidentified

Engineering Contradiction:
Improvefree memory capacityVSAvoidmemory leak cause information
Core Design Contradiction:
Quantity of substanceVSLoss of information

Solution Approach 1:

The patent introduces the memory trace table as an intermediary between the garbage collection process and memory leak identification. While garbage collection reclaims memory to increase free capacity, the trace table preserves the historical allocation information and backtraces that reveal the root causes of memory leaks, preventing loss of diagnostic information.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Quantity of substance

If applications are killed to free memory, then available memory is increased, but system complexity increases due to lack of precise identification

Engineering Contradiction:
Improveavailable memoryVSAvoidsystem management complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent replaces the mechanical approach of killing applications to free memory with a more sophisticated information-based system. The memory allocation and trace tables provide precise identification of memory leak sources, allowing the system to take targeted actions rather than brute-force application termination, thereby reducing management complexity.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

4Measurement precision

If detailed tracking of memory allocations is implemented, then memory leak identification is improved, but system overhead increases

Engineering Contradiction:
Improvememory leak detection accuracyVSAvoidsystem processing overhead
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent implements partial tracking by maintaining detailed allocation traces only for memory allocations that may be problematic, rather than uniformly tracking all memory operations. The trace table records backtrace information selectively, providing high measurement precision for memory leak detection while avoiding excessive system overhead by not duplicating full tracking for every single memory operation.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentEP2657844B1Method for tracking memory usages of a data processing system
Publication Date: 2020.09.09 APPLE INC
  • EP2657844B1 patent drawingFigure 1
  • EP2657844B1 patent drawingFigure 2
  • EP2657844B1 patent drawingFigure 3

AI summary

Techniques for tracking memory usages of a data processing system are described herein. According to one embodiment, a memory manager is to perform a first lookup operation in a memory allocation table to identify an allocation entry based on a handle representing a memory address of a memory block allocated to a client and to retrieve a trace entry pointer from the allocation entry. The memory manager is then to perform a second lookup operation in a memory trace table to identify a trace entry based on the trace entry pointer and to increment a memory allocation count of the trace entry. The memory allocation count is utilized to indicate a likelihood of the client causing a memory leak.