Patent ID: 7860906

Claim:
In a computing environment including application code that implements garbage collection functionality, wherein the garbage collection functionality includes pushing object references onto a mark stack, such that objects referenced on the mark stack can be marked so as to prevent memory for the objects from being recycled for use with other object instances, a method of handling overflows of a mark stack, the method comprising: (a) accessing a reference to an object; (b) processing the object by attempting to place references to other objects referenced in the object onto a mark stack, the mark stack being configured to facilitate marking objects to which references have been placed on the mark stack to prevent memory for the objects referenced on the mark stack from being reclaimed for other objects; (c) detecting an overflow condition of the mark stack; (d) initializing a range in a single segment which includes the object that caused the overflow condition on a per segment basis, wherein initializing the range comprises defining the maximum of the range to be the minimum address of a segment and defining the minimum of the range to be the maximum address of the segment; and (e) defining the range such that the range is defined to only include addresses in the single segment, wherein each object is stored in a segment from among a plurality of different segments of a memory heap, wherein defining a range which includes the object comprises: defining a range minimum, wherein the range minimum is the minimum of a previous range minimum and an address of the referenced other object; and defining a range maximum, wherein the range maximum is the maximum of a previous range maximum and the address of the referenced other object.