Patent ID: 8694751

Claim:
A method for managing garbage collection of memory in a heap of a functional programming language, the method comprising: identifying, by a processor, a parent object located in a first region of memory in the heap for objects that have been accessed in a predetermined time period and therefore recently used, wherein the parent object comprises references to objects; subsequent to scanning, by the processor, the references of the parent object, identifying, by the processor, a reference to a child object in the references of a the parent object, wherein the child object is also located in the first region of memory in the heap for objects that have been recently used; determining, by the processor, whether the parent object has been recently used and whether the child object has been recently used; and responsive to a determination that the parent object has been recently used and a determination that the child object has not been recently used, deferring, by the processor, a copying of the child object to a second region of memory in the heap for objects that have not been recently used and marking, by the processor, the parent object as an object to be rescanned at a later time, wherein deferring the copying prevents the child object from becoming separated from a close locality of a same memory space, including a same cache line or a cache page with the parent object.