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 input type related to allocation and de-allocation of objects or a combination of input types related to allocation and de-allocation of objects, said input types comprising;
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;
assigning a probability level to an identified source of memory leak, wherein the probability level is determined by particular input types related to allocation and de-allocation of objects, said particular input types contained in a set of input types, related to allocation and de-allocation of objects,wherein the step of obtaining the information related to memory allocation is performed in one or a combination ofadding 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.
-
Citations
22 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 input type related to allocation and de-allocation of objects or a combination of input types related to allocation and de-allocation of objects, said input types comprising; 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; assigning a probability level to an identified source of memory leak, wherein the probability level is determined by particular input types related to allocation and de-allocation of objects, said particular input types contained in a set of input types, related to allocation and de-allocation of objects, 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; wherein the agent assigns a probability level to the source of memory leak, wherein the probability level is determined by input types related to allocation de-allocation of objects, said input types comprising; 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. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A computer-readable storage 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 input types related allocations of objects, and collecting second input types related to de-allocations of the objects, and for a class of objects, the input types comprises; 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, including assigning a probability level to the objects, wherein the probability level is determined by the input types. - View Dependent Claims (16, 17)
-
-
18. A method for determining sources of memory leaks in a program, comprising:
-
associating each input type to a confidence level that indicates a probability that an object is a component of the memory leaks, said input type related to allocation de-allocation of objects; wherein a confidence level based on two or more input types is based on two or more confidence levels each associated with a input type of the two or more input types; and while the program is running, based on a sampling frequency, collecting a plurality of input types related to allocations and de-allocations of objects of the program; and
based on the collected input types, providing confidence levels associated with the input types;wherein an input type is selected from; first difference in a ratio of object allocation and a ratio of object de-allocation of a class; a change in the first difference over time while the program is running; a change in the first difference after a transaction of the program is executed; second difference in a number of allocations and a number of de-allocation for an object; a change in the second difference over time while the program is running; a change the second difference after a transaction of the program is executed; a change in a heap size of the program; similarity in a number Of allocations of an object and a leak rate. - View Dependent Claims (19, 22)
-
-
20. A system comprising:
-
means for determining, in a computer, a memory leak rate of a program; means for determining a number of allocations of an object; means for determining, in a computer, whether the object is the source of the memory leak; wherein determining, in a computer, whether the object is the source of the memory leak 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; means for assigning a probability level to the object as the source of memory leak, wherein the probability level is determined by a set of data types including at least one of the memory leak rate and the number of allocations of the object; wherein determining whether the object is the source of the memory leak is based further on one or a combination of; first difference in a ratio of object allocation and a ratio of object de-allocation of a class; a change in the first difference over time while the program is running; a change in the first difference after a transaction of the program is executed; second difference in a number of allocations and a number of de-allocation for an object; a change in the second difference over time while the program is running; a change the second difference after a transaction of the program is executed; and a change in a heap size of the program. - View Dependent Claims (21)
-
Specification