摘要 |
Aspects for conservative garbage collecting are disclosed. In one aspect, root objects included in a call stack are identified, which comprise integers and pointers. Integer representations are tagged and distinguishable from untagged pointer representations. Root objects are traced to corresponding memory locations such that a subsequent tracing is performed on the pointer representations and skipped on the integer representations. Memory allocated to objects unreachable by the call stack is then freed. In another aspect, an object graph associated with a call stack is tagged, and a heap is generated comprising objects included in an executed portion of the call stack. Objects included in an unexecuted portion of the call stack are traced to corresponding memory locations on the heap such that a subsequent tracing is only performed on the untagged pointer representations. Memory locations corresponding to heap objects unreachable by the unexecuted portion of the call stack are then cleared.
|