Parallel marking processing method and device for garbage collection

2017 
A marking method and device for garbage collection, wherein the method comprises: traversing, according to a corresponding relationship between a memory block in a virtual machine heap and N marked threads, a first object in the virtual machine heap, wherein N is an integer greater than 1, a memory volume occupied by the N marked threads is pre-configured, and each of the marked threads at least comprises: one private stack (101); pushing a first pointer of a first object being currently processed onto a private stack of a marked thread corresponding to a memory block where the first object is located, and performing, according to a push state of the first pointer, first marking processing on the first object (102); after traversing of the first object is completed, sending a thread initiation instruction to the N marked threads, such that the N marked threads are able to synchronously perform marking processing for garbage collection according to the push state of the first pointer in the respective private stacks of the N marked threads (103). In the present invention, parallel marking processing of multiple threads can be realized using limited internal memory, improving the overall garbage collection performance.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    2
    References
    0
    Citations
    NaN
    KQI
    []