Identifying memory leaks in computer systems
First Claim
Patent Images
1. A method for identifying a source of memory leak in a program, comprising:
- while the program is running obtaining information related to memory allocation of objects;
obtaining information related to memory de-allocation of the objects;
providing information related to the source of the memory leak based on one or a combination of first difference in ratios of object allocation and de-allocation for a class;
second difference between a number of allocations and a number of de-allocations of an object;
a change in the first difference over time during execution of the program;
a change in the second difference over time during execution of the program;
a change in the first difference after a transaction of the program is executed;
a change in the second difference after a transaction of the program is executed;
a change in a heap size used by the program during its execution; and
similarity in the number of allocations of the object and a leak rate;
wherein the step of obtaining the information related to memory allocation is performed in one or a combination of adding additional code to a class file that causes the information to be provided when the class file is being executed; and
requesting an interface to provide the information.
2 Assignments
0 Petitions
Accused Products
Abstract
Embodiments of the invention relate to identifying sources of memory leaks. In an embodiment, an agent collects information related to object allocations and de-allocations in accordance with a sampling period, and, based on the relationship between object allocations and de-allocations, the agent analyzes the data and reports the results. Other embodiments are also disclosed.
68 Citations
24 Claims
-
1. A method for identifying a source of memory leak in a program, comprising:
-
while the program is running obtaining information related to memory allocation of objects;
obtaining information related to memory de-allocation of the objects;
providing information related to the source of the memory leak based on one or a combination of first difference in ratios of object allocation and de-allocation for a class;
second difference between a number of allocations and a number of de-allocations of an object;
a change in the first difference over time during execution of the program;
a change in the second difference over time during execution of the program;
a change in the first difference after a transaction of the program is executed;
a change in the second difference after a transaction of the program is executed;
a change in a heap size used by the program during its execution; and
similarity in the number of allocations of the object and a leak rate;
wherein the step of obtaining the information related to memory allocation is performed in one or a combination of adding additional code to a class file that causes the information to be provided when the class file is being executed; and
requesting an interface to provide the information. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system for providing information, comprising:
-
a Java Virtual Machine;
an agent including computer-executable instructions;
a processor processing data stored in memory; and
a class file;
wherein the Java Virtual Machine provides the class file to the agent when the class file is about to be loaded into the memory;
the agent adds additional code into the class file in order to collect information related to memory allocation of an object based on a frequency including a first period of collecting the information and a second period of skipping collecting the information; and
the agent returns the instrumented class file to the Java Virtual Machine for it to load the instrumented class file into the memory;
while the instrumented class file is being executed by the processor the additional code causes the information to be provided; and
the information is for use in identifying a source of memory leak. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A computer-readable medium embodying instructions for a computer to perform a method for identifying a source of a memory leak in a program, the method comprising:
-
based on a sampling frequency, collecting first information related allocations of objects, and collecting second information related to de-allocations of the objects; and
for a class determining an allocation ratio for the class;
determining a de-allocation ratio for the class;
determining a difference between the allocation ratio and the de-allocation ratio;
comparing the difference against a threshold; and
based on results of comparing, determining whether objects of the class are part the source of the memory leak. - View Dependent Claims (16, 17)
-
-
18. A method for determining sources of memory leaks in a program, comprising:
-
associating each data type to a confidence level that an object is a component of the memory leaks;
wherein a confidence level based on two or more data types is based on two or more confidence levels each associated with a data type of the two or more data types; and
while the program is running, based on a sampling frequency, collecting a plurality of data types related to allocations and de-allocations of objects of the program; and
based on the collected data types, providing confidence levels associated with the data types. - View Dependent Claims (19, 20)
-
-
21. A system comprising:
-
means for determining a memory leak rate of a program;
means for determining a number of allocations of an object;
means for determining whether the object is a component of the leak rate;
wherein determining whether the object is a component of the leak rate is based on the memory leak rate and the number of allocations of the object; and
all determining is performed while the program is being executed. - View Dependent Claims (22, 23, 24)
-
Specification