摘要 |
A process and a system for relocating objects in real-time during garbage collection are provided to enable a developer to offer the more stable system having small memory leakage and no dangling reference by guaranteeing proper allocation and reuse of a memory. A relocation engine reads the first object, writes the second object associated with the first object, fetches a class pointer associated with the first object to a trap class(110), sets a forwarding pointer to the second object, and scans a global stack(112). If the reference for the first object is present, the relocation engine updates the reference according to the first forwarding pointer, selects the first thread of a stopped mutator thread(104), and scans a mutator stack(114) associated with the first state. If the reference for the first object is present, the relocation engine updates the reference according to the first forwarding pointer, and displays that the first thread is scanned among the stopped mutator threads. A scheduler restarts the mutator thread before the second mutator stack associated with the second thread of the stopped mutator thread is scanned after the first thread is displayed as the scanned thread.
|