Code Transformation for Memory Leak Identification
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for identifying memory leaks in software object execution are inefficient, as they require human analysts to examine numerous call stacks and often result in untraceable sources due to the complexity of object instantiation and garbage collection processes, especially when multiple components and services utilize the same classes, leading to performance impacts and difficulties in pinpointing memory leaks without access to source code.
Innovation Solution
A method that uses a code transformation tool to insert executable code into existing constructors, generating execution tracing data during object instantiation, allowing for the creation of private records that include call stack information, facilitating memory leak identification without requiring access to source code and minimizing performance impact.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If garbage collection is executed with lower priority than other applications, then system performance is maintained, but memory leaks cannot be kept up with causing slowdowns and errors
Solution Approach 1:
The patent inserts record generating code into constructors during compile time, performing preliminary action to capture execution tracing data before memory leaks occur. This allows the system to proactively record object instantiation information without requiring continuous high-priority garbage collection execution.
Solution Approach 2:
The patent introduces an intermediary mechanism (record generating code and execution tracing data) between the object instantiation process and memory leak detection. This intermediary captures call stack information at the point of object creation, enabling indirect detection of memory leaks without direct intervention in the garbage collection priority scheduling.
2Measurement precision
If code transformation tool inserts executable code into existing constructors, then execution tracing data is generated for memory leak identification, but device complexity increases
Solution Approach 1:
The patent employs self-service by having the code transformation tool automatically generate and insert record generating code into constructors without manual intervention. The tool serves itself by programmatically modifying the bytecode, reducing the need for complex manual code insertion processes while maintaining measurement precision.
Solution Approach 2:
The patent uses copying by creating a copy of the constructor code and inserting additional record generating code alongside the original instantiation logic. This copying approach allows the original functionality to remain intact while adding tracing capabilities, simplifying the overall transformation process compared to completely rewriting constructors.
3Adaptability or versatility
If multiple components and services utilize the same classes, then system versatility is improved, but memory leak tracing becomes untraceable due to complexity
Solution Approach 1:
The patent applies segmentation by dividing the memory leak detection problem into individual object instances. Each object instantiated through constructors has its own execution tracing data and call stack information recorded separately. This segmentation allows precise tracking of which specific component or service instantiated which object, even when multiple components use the same classes, thereby resolving the tracing difficulty in versatile systems.
Data Source
AI summary
Using a code transformation tool, a portion of executable code is inserted into existing executable code, the existing executable code comprising an existing constructor of a class, the existing constructor, when executed, instantiating an object of the class. During execution of the existing constructor, execution of the portion is caused to occur, the execution generating a record, the record comprising execution tracing data of the object.


