Resource Leak Detection via Must-Access Paths

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Resource leaks in programming, such as unreleased input/output streams, fonts, and database connections, lead to system performance degradation and crashes, as programmers struggle to manage finite system resources despite garbage collection handling memory management.

Innovation Solution

A method and system for detecting resource leaks using static analysis that employs dynamically adjustable sets of must-access paths to track resources within a program, generating and modifying these paths based on control flow analysis to determine if resources are unreachable at exit points, with a reporting module prioritizing witnessed leaks over potential leaks due to analysis limitations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If static analysis is used to track resources through program control flow, then resource leak detection accuracy is improved, but analysis complexity and computational overhead increase

Engineering Contradiction:
Improveresource leak detection accuracyVSAvoidanalysis complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the program analysis into control flow graph construction and resource tracking phases. The control flow graph divides the program into basic blocks and control flow edges, enabling systematic tracking of resource acquisition and release points through structured graph traversal rather than analyzing the entire program monolithically.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces must-access paths as an intermediary mechanism between resource acquisition points and release points. These paths serve as mediators that connect resource management operations through the control flow graph, enabling precise tracking of resource lifecycle without requiring direct analysis of all possible execution paths.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If comprehensive control flow analysis is performed to detect all resource leaks, then detection coverage is improved, but false positives increase due to analysis limitations

Engineering Contradiction:
Improvedetection coverageVSAvoidfalse positive rate
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The patent dynamically generates must-access paths based on control flow analysis results. Rather than using fixed or static access paths, the system adapts the must-access paths during analysis by traversing the control flow graph and identifying relevant acquisition and release points, allowing the analysis to focus on actual resource lifecycle paths and reduce spurious detections.

Inventive Principle:
Principle #15Dynamics

3Manufacturing precision

If detailed tracking of resource access paths is implemented, then resource management accuracy is improved, but processing time increases

Engineering Contradiction:
Improveresource management accuracyVSAvoidprocessing time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The patent performs preliminary construction of the control flow graph before resource tracking analysis. By pre-processing the program to establish control flow relationships, basic blocks, and transfer edges in advance, the system avoids redundant analysis during the resource tracking phase, significantly reducing overall processing time while maintaining detailed tracking accuracy.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8689180B2Systems and methods for resource leak detection
Publication Date: 2014.04.01 GLOBALFOUNDRIES US INC
  • US8689180B2 patent drawing
  • US8689180B2 patent drawing
  • US8689180B2 patent drawing

AI summary

Systems and methods for detecting resource leaks in a program using static analysis are disclosed. Dynamically adjustable sets of must-access paths can be employed for aliasing purposes to track resources intra- and inter-procedurally through a program. Actionable reports are also disclosed, in which resource leaks are prioritized, filtered and clustered to improve utility.