Patent ID: 8126941

Claim:
A memory management method for performing garbage collection, comprising the steps of: providing in a memory a heap space partitioned into a plurality of areas including first and second areas, the first area being currently used for object allocation, the second area being to be used for object allocation after the garbage collection; in a first garbage collection, copying objects reachable from a root set among objects allocated in the first area into the second area; registering, as finalization targets, finalizable objects among the objects allocated in the first area which objects are unreachable from the root set and have a finalize method; thereafter in a second garbage collection, checking whether, in the first garbage collection, a finalization of the finalizable objects regarded as the finalization targets has been completed; and if the finalization of finalizable objects (i) has been completed, finalizing the finalizable objects of finalization targets allocated in the first area and if the finalization of finalizable objects (ii) has not been completed, preventing performance of the second garbage collection until the finalization has been completed.