Heap Memory Leak Profiling via Allocation Sampling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Memory leaks in computing systems are challenging to detect and resolve due to the large amount of data in heap dumps, which can be cumbersome and insecure, and often result in performance degradation and crashes, especially when garbage collection is insufficient.

Innovation Solution

A memory profiling system that samples and tracks a subset of objects on the heap based on selection criteria such as allocation span and time, generating profiles that include allocation-time information and visualizations to quickly isolate and resolve memory leaks without the need for full heap dumps.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If full heap dumps are used to detect memory leaks, then detection completeness is improved, but system overhead and security risks increase

Engineering Contradiction:
Improvedetection completenessVSAvoidsystem overhead
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the heap memory into manageable portions and uses sampling techniques to select representative subsets of objects for analysis. Instead of dumping the entire heap, the system divides memory into regions and samples objects from each region, reducing the overall data volume while maintaining detection effectiveness.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts only the necessary information for memory leak detection from the heap memory. It identifies and extracts specific object attributes (allocation span, time, reference chains) that are relevant to detecting leaks, while ignoring irrelevant data. This extraction approach reduces overhead while preserving detection capability.

Inventive Principle:
Principle #2Taking out (Extraction)

2Measurement precision

If full heap dumps are used to detect memory leaks, then detection completeness is improved, but security risks increase

Engineering Contradiction:
Improvedetection completenessVSAvoidsecurity risks
Core Design Contradiction:
Measurement precisionVSObject-affected harmful factors

Solution Approach 1:

The patent extracts only the necessary information for memory leak detection from the heap memory. It identifies and extracts specific object attributes (allocation span, time, reference chains) that are relevant to detecting leaks, while ignoring irrelevant data. This extraction approach reduces overhead while preserving detection capability.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If garbage collection is used to prevent memory leaks, then memory management is improved, but memory leaks still occur when objects remain accessible

Engineering Contradiction:
Improvememory managementVSAvoidmemory leaks
Core Design Contradiction:
ReliabilityVSLoss of substance

Solution Approach 1:

The patent implements a feedback mechanism that continuously monitors object lifecycles and allocation patterns. By tracking objects from allocation to deallocation and analyzing reference chains, the system provides feedback about potential memory leaks that garbage collection missed. This feedback enables proactive identification and resolution of leaks before they cause significant damage.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent performs preliminary analysis of object allocation patterns and reference chains before memory leaks become critical. By proactively identifying objects that should have been collected but remain accessible, the system can take preventive action before memory consumption becomes problematic.

Inventive Principle:
Principle #10Preliminary action

4Measurement precision

If memory leak detection is performed continuously, then detection accuracy is improved, but performance overhead increases

Engineering Contradiction:
Improvedetection accuracyVSAvoidperformance overhead
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent employs periodic sampling of heap objects at strategically chosen intervals rather than continuous monitoring. It uses allocation events and garbage collection cycles as triggers for analysis, performing detection activities periodically when relevant changes occur in memory management. This periodic approach maintains detection accuracy while significantly reducing performance overhead compared to continuous monitoring.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentUS10635570B2Memory leak profiling events
Publication Date: 2020.04.28 ORACLE INT CORP
  • US10635570B2 patent drawing
  • US10635570B2 patent drawing
  • US10635570B2 patent drawing

AI summary

Techniques for profiling memory leaks are described. In one or more embodiments, a memory profiling system identifies a set of one or more objects on the heap during application runtime. For each respective object in the subset of objects, the memory profiling system stores a set of sample information including timestamp that identifies a time associated with an allocation on the heap memory was performed for the respective object and a stack trace identifying at least one subroutine that triggered the allocation on the heap memory. Responsive to detecting a memory leak, the memory profiling system generates a memory leak profile for at least one object in the subset of objects that is causing the memory leak. The memory leak profile identifies when the allocation on the memory store for the at least one object was performed and information about object that remained live after the potential memory leak.