Patent ID: 8489652

Claim:
A method for managing an object watchpoint during a garbage collection cycle, comprising: identifying an object having a field, wherein the object is associated with an original object location, wherein the field is associated with an original field location, and wherein the object and the field are located in a memory heap of a virtual machine memory; setting, within a debugger, the object watchpoint on the original field location, wherein the object watchpoint is a memory trap associated with the object; identifying a card table comprising a card mapping to a plurality of locations including the original object location; setting a hidden watchpoint on a card table entry corresponding to the card, wherein the hidden watchpoint is a memory trap associated with the card table entry; catching a hidden watchpoint event triggered by a garbage collector (GC) accessing the card table entry during a relocation of the object by the GC; pausing the garbage collection cycle in response to catching the hidden watchpoint; accessing a value from a move_from field after catching the hidden watchpoint; comparing the value with the original object location to generate a match; determining a new object location associated with the object by accessing, based on the match, a move_to field referencing the new object location; determining a new field location of the field based on the new object location; setting, within the debugger, the object watchpoint on the new field location; and resuming the garbage collection cycle after setting the object watchpoint on the new field location, wherein the GC accesses the card table entry during the relocation.