Resource Leak Detection via Must-Access Paths
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
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
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.
3Manufacturing precision
If detailed tracking of resource access paths is implemented, then resource management accuracy is improved, but processing time increases
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.
Data Source
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.


