Detecting and remedying memory leaks caused by object reference cycles
First Claim
1. A computer-implemented method comprising:
- parsing programming code to identify instructions within the programming code to allocate objects and instructions within the programming code to create, delete, and/or update references to the objects;
generating, based upon the identified instructions, a model of memory used when the programming code is executed, wherein the model includes representations of the objects and representations of changes to the references to the objects;
detecting, based upon the representations in the model, a potential memory leak by identifying that each of a plurality of the objects is referenced by another of the plurality of the objects but unreachable by any variable at a point of execution of the programming code; and
generating, in response to the detection of the potential memory leak, a report to flag the potential memory leak, wherein generating the report includes highlighting, in a graphical user interface, a portion of the programming code causing the potential memory leak.
2 Assignments
0 Petitions
Accused Products
Abstract
Exemplary methods, apparatuses, and systems parse programming code to identify instructions within the programming code to allocate objects and instructions within the programming code to create, delete, and/or update references to the objects. Based upon the identified instructions, a model of memory used when the programming code is executed is generated. The model includes representations of the objects and representations of changes to the references to the objects. Based upon the representations in the model, it is determined that each of a plurality of the objects is connected to another of the plurality of objects by one of the references but unreachable by any variable at a point of execution of the programming code. In response to the determination that the plurality of objects is unreachable, a report is generated to flag the unreachable plurality of objects as a potential memory leak for correction.
-
Citations
20 Claims
-
1. A computer-implemented method comprising:
-
parsing programming code to identify instructions within the programming code to allocate objects and instructions within the programming code to create, delete, and/or update references to the objects; generating, based upon the identified instructions, a model of memory used when the programming code is executed, wherein the model includes representations of the objects and representations of changes to the references to the objects; detecting, based upon the representations in the model, a potential memory leak by identifying that each of a plurality of the objects is referenced by another of the plurality of the objects but unreachable by any variable at a point of execution of the programming code; and generating, in response to the detection of the potential memory leak, a report to flag the potential memory leak, wherein generating the report includes highlighting, in a graphical user interface, a portion of the programming code causing the potential memory leak. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory computer-readable medium storing instructions, which when executed by a processing device, cause the processing device to perform a method comprising:
-
parsing programming code to identify instructions within the programming code to allocate objects and instructions within the programming code to create, delete, and/or update references to the objects; generating, based upon the identified instructions, a model of memory used when the programming code is executed, wherein the model includes representations of the objects and representations of changes to the references to the objects; detecting, based upon the representations in the model, a potential memory leak by identifying that each of a plurality of the objects is referenced by another of the plurality of the objects but unreachable by any variable at a point of execution of the programming code; and generating, in response to the detection of the potential memory leak, a report to flag the potential memory leak, wherein generating the report includes highlighting, in a graphical user interface, a portion of the programming code causing the potential memory leak. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. An apparatus comprising:
-
a processing device; and a memory coupled to the processing device, the memory storing instructions which, when executed by the processing device, cause the apparatus to; parse programming code to identify instructions within the programming code to allocate objects and instructions within the programming code to create, delete, and/or update references to the objects; generate, based upon the identified instructions, a model of memory used when the programming code is executed, wherein the model includes representations of the objects and representations of changes to the references to the objects; detect, based upon the representations in the model, a potential memory leak by identifying that each of a plurality of the objects is referenced by another of the plurality of the objects but unreachable by any variable at a point of execution of the programming code; and generate, in response to a detection of the potential memory leak, a report to flag the potential memory leak, wherein generating the report includes highlighting, in a graphical user interface, a portion of the programming code causing the potential memory leak. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification