摘要 |
A technique for dynamically relocating an object during garbage collection involves guaranteeing bounds on thread pause times. A process according to the technique may include pausing threads, bounding pause times by scanning only one of a plurality of threads, and resuming the threads. Another process according to the technique may include suspending a plurality of threads, relocating an object to a new memory location, updating references associated with an old memory location for only one of the threads such that the references are associated with the new memory location, and resuming the threads. In an embodiment, the process may include initially marking each of the threads "unscanned." In another embodiment, the process may include reading the object from the first memory location and writing the object to the second memory location. An example system according to the technique may include a scheduler and a relocation engine. In an embodiment, the scheduler may suspend threads in preparation for dynamic object relocation and then resumes the threads after scanning one, and only one, of the thread stacks. In an embodiment, the thread associated with the scanned thread stack may then be marked "scanned."
|