Patent ID: 8326894

Claim:
A computer-implemented method for processing memory access events, comprising: executing an extended program including instrumented memory tracking code for tracking memory access events of a plurality of objects; allocating a unique identifier for each of the plurality of tracked objects; creating a weak reference for each of the plurality of tracked objects, wherein a mapping relationship is established between the identifier of the weak reference and that of the corresponding tracked object; binding the weak reference of the object with a reference queue: recording and storing the memory access events of the plurality of tracked objects; in response to the object being garbage collected, putting the weak reference of the object into the reference queue: and reading-out the identifier of the weak reference of the object from the reference queue, and including it in a notification of garbage collection: in response to receiving the notification of memory garbage collection, which includes an identifier of a weak reference of a collected object, determining the identifier of the collected object based on the mapping relationship between the identifier of the weak reference and that of the corresponding tracked object, and searching the stored memory access events for the memory access events of the collected object; and deleting the memory access events of the collected object.