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改进都是基于此算法的改进。

  • 相关阅读:
    暑假第三周
    暑假第二周
    bzoj3572:[Hnoi2014]世界树
    bzoj3998:[TJOI2015]弦论
    luoguP4242树上的毒瘤
    bzoj1339/1163:[Baltic2008]Mafia
    bzoj3507:[Cqoi2014]通配符匹配
    bzoj1449:[JSOI2009]球队收益/bzoj2895:球队预算
    bzoj2243:[SDOI2011]染色
    bzoj4516:[Sdoi2016]生成魔咒
  • 原文地址:https://www.cnblogs.com/tekkaman/p/2578131.html
Copyright © 2011-2022 走看看