Patent ID: 8429620

Claim:
A method for diagnosing a memory leak, the method comprising: tracing allocation of at least one object performed at runtime on a virtual machine, the object being created by an application program wherein the tracing including: acquiring corresponding allocation paths and corresponding allocation times of the objects; and recording the corresponding allocation paths and the corresponding allocation times of the objects, with the recording comprising assigning a unique identifier (ID) to each of the objects corresponding to the allocation path; counting age generations of the objects of a similar type based on the corresponding allocation paths at a preset time interval; identifying a suspicious allocation path having the objects with high age generations; and reporting the suspicious allocation path to a user, wherein the user analyzes the objects with suspicious allocation paths to be a cause for the memory leak; wherein the assigning further comprises aggregating a band ID and a group ID of each of the objects, wherein the band ID and the group ID are related to the allocation path into a tag, and binding the tag with the corresponding object, wherein the tag further includes information about a type of the corresponding object, the allocation path, an address pointing to a storage of a method signature and a callee.