Method and system for memory leak detection in an object-oriented environment during real-time trace processing
First Claim
1. A process for profiling a program in a data processing system, the process comprising the computer-implemented steps of:
- allocating a first object during execution of a method;
obtaining a reference to a profile data area associated with the method; and
updating object allocation metrics in the profile data area associated with the method, wherein updating the object allocation metrics includes incrementing at least one of an object allocation count in the profile data area associated with the method and a byte allocation count in the profile data area associated with the method.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system for detecting memory leaks in an object-oriented environment during real-time trace processing is provided. During the profiling of a program executing in a data processing system, a profiler processes events caused by the execution of the program, and the profiler maintains a profile data structure containing execution-related metrics for the program. The execution-related metrics may include object allocation and deallocation metrics that are associated with object processing initiated on behalf of an executing method. An object allocator allocates objects during the execution of the program and modifies object allocation metrics in the profile data structure. An object deallocator, such as a garbage collector, deallocates objects during the execution of the program and modifies object deallocation metrics in the profile data structure. The object allocation metrics and the object deallocation metrics may be compared to identify memory leaks.
-
Citations
37 Claims
-
1. A process for profiling a program in a data processing system, the process comprising the computer-implemented steps of:
-
allocating a first object during execution of a method;
obtaining a reference to a profile data area associated with the method; and
updating object allocation metrics in the profile data area associated with the method, wherein updating the object allocation metrics includes incrementing at least one of an object allocation count in the profile data area associated with the method and a byte allocation count in the profile data area associated with the method. - View Dependent Claims (3, 4, 5, 6, 7, 8, 9)
incrementing an object allocation count in the profile data area associated with the method.
-
-
4. The process of claim 1 further comprising:
incrementing a byte allocation count in the profile data area associated with the method.
-
5. The process of claim 1 further comprising:
-
allocating a second object during execution of the method;
obtaining the reference to the profile data area associated with the method; and
updating the object allocation metrics in the profile data area associated with the method.
-
-
6. The process of claim 1 further comprising:
-
receiving an object allocation event during execution of a method; and
returning a reference to a profile data area for the method.
-
-
7. The process of claim 6 further comprising:
in response to a determination that a profile data area has not been allocated for the method, allocating a profile data area for the method.
-
8. The process of claim 7 further comprising:
storing the reference to the profile data area for the method in a call stack tree data structure.
-
9. The process of claim 1 further comprising:
-
obtaining, from the first object, the reference to the profile data area associated with the method;
updating object deallocation metrics in the profile data area associated with the method; and
deallocating the first object.
-
-
2. A process for profiling a program in a data processing system, the process comprising the computer-implemented steps of:
-
allocating a first object during execution of a method;
obtaining a reference to a profile data area associated with the method;
updating object allocation metrics in the profile data area associated with the method; and
storing, in the first object, the reference to the profile data area associated with the method.
-
-
10. A process for profiling a program in a data processing system, the process comprising the computer-implemented steps of:
-
allocating a first object during execution of a method;
obtaining a reference to a profile data area associated with the method;
updating object allocation metrics in the profile data area associated with the method; and
comparing the object allocation metrics and object deallocation metrics to identify memory leaks.
-
-
11. A process for profiling a program in a data processing systems, the process comprising the computer-implemented steps of:
-
allocating a first object during execution of a method;
obtaining a reference to a profile data area associated with the method; and
updating object allocation metrics in the profile data area associated with the method, wherein the profile data area comprises execution context information for the method.
-
-
12. A data processing system for profiling a program, the data processing system comprising:
-
a profiler for processing events during the execution of the program, wherein the profiler maintains a profile data structure containing execution-related metrics for the program;
an object allocator for allocating objects during execution of the program, wherein the object allocator modifies object allocation metrics in the profile data structure; and
an object deallocator for deallocating objects during the execution of the program, wherein the object deallocator modifies object deallocation metrics in the profile data structure, and wherein the object allocation metrics and the object deallocation metrics may be compared to identify memory leaks. - View Dependent Claims (14)
-
-
13. A data processing system for profiling a program, the data processing system comprising:
-
a profiler for processing events during the execution of the program, wherein the profiler maintains a profile data structure containing execution-related metrics for the program;
an object allocator for allocating objects during execution of the program, wherein the object allocator modifies object allocation metrics in the profile data structure; and
an object deallocator for deallocating objects during the execution of the program, wherein the object deallocator modifies object deallocation metrics in the profile data structure, and wherein the execution-related metrics are identifiably associated with an individual method.
-
-
15. A data processing system for profiling a program, the data processing system comprising:
-
a profiler for processing events during the execution of the program, wherein the profiler maintains a profile data structure containing execution-related metrics for the program;
an object allocator for allocating objects during execution of the program, wherein the object allocator modifies object allocation metrics in the profile data structure; and
an object deallocator for deallocating objects during the execution of the program, wherein the object deallocator modifies object deallocation metrics in the profile data structure, and wherein the profile data structure comprises execution context information for program methods.
-
-
16. A data processing system for profiling a program, the data processing system comprising:
-
first allocating means for allocating a first object during execution of a method;
first obtaining means for obtaining a reference to a profile data area associated with the method; and
first updating means for updating object allocation metrics in the profile data area associated with the method, wherein the first updating means includes incrementing means for incrementing at least one of an object allocation count in the profile area associated with the method and a byte allocation count in the profile area associated with the method. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
incrementing means for incrementing an object allocation count in the profile data area associated with the method.
-
-
19. The data processing system of claim 16 further comprising:
incrementing means for incrementing a byte allocation count in the profile data area associated with the method.
-
20. The data processing system of claim 16 further comprising:
-
second allocating means for allocating a second object during execution of the method;
second obtaining means for obtaining the reference to the profile data area associated with the method; and
second updating means for updating the object allocation metrics in the profile data area associated with the method.
-
-
21. The data processing system of claim 16 further comprising:
-
receiving means for receiving an object allocation event during execution of a method; and
returning means for returning a reference to a profile data area for the method.
-
-
22. The data processing system of claim 21 further comprising:
second allocating means for allocating, in response to a determination that a profile data area has not been allocated for the method, a profile data area for the method.
-
23. The data processing system of claim 22 further comprising:
storing means for storing the reference to the profile data area for the method in a call stack tree data structure.
-
24. The data processing system of claim 16 further comprising:
-
second obtaining means for obtaining, from the first object, the reference to the profile data area associated with the method;
second updating means for updating object deallocation metrics in the profile data area associated with the method; and
deallocating means for deallocating the first object.
-
-
17. A data processing system for profiling a program, the data processing system comprising:
-
first allocating means for allocating a first object during execution of a method;
first obtaining means for obtaining a reference to a profile data area associated with the method;
first updating means for updating object allocation metrics in the profile data area associated with the method; and
first storing means for storing, in the first object, the reference to the profile data area associated with the method.
-
-
25. A data processing system for profiling a program, the data processing system comprising:
-
first allocating means for allocating a first object during execution of a method;
first obtaining means for obtaining a reference to a profile data area associated with the method;
first updating means for updating objects allocation metrics in the profile data area associated with the method; and
comparing means for comparing the object allocation metrics and object deallocation metrics to identify memory leak.
-
-
26. A data processing system for profiling a program, the data processing system comprising:
-
first allocating means for allocating a first object during execution of a method;
first obtaining means for obtaining a reference to a profile data area associated with the method;
first updating means for updating object allocation metrics in the profile data area associated with the method, wherein the profile data area comprises execution context information for the method.
-
-
27. A computer program product in a computer-readable medium for use in a data processing system for profiling a program, the computer program product comprising:
-
first instructions for allocating a first object during execution of a method;
second instructions for obtaining a reference to a profile data area associated with the method; and
third instructions for updating object allocation metrics in the profile data area associated with the method, wherein the third instructions include instructions for incrementing at least one of an object allocation count in the profile data area associated with the method and a byte allocation count in the profile data area associated with the method. - View Dependent Claims (29, 30, 31, 32, 33, 34, 35)
instructions for incrementing an object allocation count in the profile data area associated with the method.
-
-
30. The computer program product of claim 27 further comprising:
instructions for incrementing a byte allocation count in the profile data area associated with the method.
-
31. The computer program product of claim 27 further comprising:
-
instructions for allocating a second object during execution of the method;
instructions for obtaining the reference to the profile data area associated with the method; and
instructions for updating the object allocation metrics in the profile data area associated with the method.
-
-
32. The computer program product of claim 27 further comprising:
-
instructions for receiving an object allocation event during execution of a method; and
instructions for returning a reference to a profile data area for the method.
-
-
33. The computer program product of claim 32 further comprising:
instructions for allocating, in response to a determination that a profile data area has not been allocated for the method, a profile data area for the method.
-
34. The computer program product of claim 33 further comprising:
instructions for storing the reference to the profile data area for the method in a call stack tree data structure.
-
35. The computer program product of claim 27 further comprising:
-
instructions for obtaining, from the first object, the reference to the profile data area associated with the method;
instructions for updating object deallocation metrics in the profile data area associated with the method; and
instructions for deallocating the first object.
-
-
28. A computer program product in a computer-readable medium for use in a data processing system for profiling a program, the computer program product comprising:
-
first instructions for allocating a first object during execution of a method;
second instructions for obtaining a reference to a profile data area associated with the method;
third instructions for updating object allocation metrics in the profile data area associated with the method; and
instructions for storing, in the first object, the reference to the profile data area associated with the method.
-
-
36. A computer program product in a computer-readable medium for use in a data processing system for profiling a program, the computer program product comprising:
-
first instructions for allocating a first object during execution of a method;
second instructions for obtaining a reference to a profile data area associated with the method;
third instructions for updating object allocation metrics in the profile data area associated with the method; and
instructions for comparing the object allocation metrics and object deallocation metrics to identify memory leaks.
-
-
37. A computer program product in a computer-readable medium for use in a data processing system for profiling a program, the computer program product comprising:
-
first instructions for allocating a first object during execution of a method;
second instructions for obtaining a reference to a profile data area associated with the method; and
third instructions for updating object allocation metrics in the profile data area associated with the method, wherein the profile data area comprises execution context information for the method.
-
Specification