zoukankan      html  css  js  c++  java
  • Markandsweep algorithm

    Mark-and-sweep algorithm

      This algorithm reduces the definition of "an object is not needed anymore" to "an object is unreachable".

      从"an object is not needed anymore" 进化到 "an object is unreachable".

      This algorithm assumes the knowledge of a set of objects called roots  Periodically, the garbage-collector will start from these roots, find all objects that are referenced from these roots, then all objects referenced from these, etc. Starting from the roots, the garbage collector will thus find all reachable objects and collect all non-reachable objects.

      从roots扫描,找出所有可引用点,同时剩下的也就是不可引用点。

     

      As of 2012, all modern browsers ship a mark-and-sweep garbage-collector. All improvements made in the field of JavaScript garbage collection (generational/incremental/concurrent/parallel garbage collection) over the last few years are implementation improvements of this algorithm, but not improvements over the garbage collection algorithm itself nor its reduction of the definition of when "an object is not needed anymore".

      近几年的GC改进都是基于此算法的改进。

  • 相关阅读:
    X
    W
    J
    A
    Q
    P
    B
    排列和组合的求解
    深度学习之序列处理
    32位和64位数据类型大小对比
  • 原文地址:https://www.cnblogs.com/tekkaman/p/2578131.html
Copyright © 2011-2022 走看看