Memory Manager Tracking Allocations via Trace Tables
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
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
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.
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
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.
4Measurement precision
If detailed tracking of memory allocations is implemented, then memory leak identification is improved, but system overhead increases
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.
Data Source
Figure 1
Figure 2
Figure 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.