zoukankan      html  css  js  c++  java
  • New Garbage Collector http://wiki.luajit.org/New-Garbage-Collector

    New Garbage Collector http://wiki.luajit.org/New-Garbage-Collector

    GC Algorithms

    This is a short overview of the different GC algorithms used in Lua 5.x and LuaJIT 1.x/2.0 as well as the proposed new GC in LuaJIT 3.0.

    All of these implementations use a tracing garbage collector (#) with two basic phases:

    • The mark phase starts at the GC roots (e.g. the main thread) and iteratively marks all reachable (live) objects. Any objects that remain are considered unreachable, i.e. dead.
    • The sweep phase frees all unreachable (dead) objects.

    Any practical GC implementation has a couple more phases (e.g. an atomic phase), but this is not relevant to the following discussion. To avoid a recursive algorithm, a mark stack or mark list can be used to keep track of objects that need to be traversed.

    Note that most of the following is just describing well-established techniques. Please refer to the literature on garbage collection for details.

    (#) 'Tracing' in this context means it's tracing through the live object graph, as opposed to a reference counting garbage collector, which manages reference counts for each object. The terminology is not related to the concept of a trace compiler.

  • 相关阅读:
    让你平步青云的10个谈话技巧
    瑞士心理学家和精神分析医师――荣格
    市场倍增理论
    淘宝网格,淘宝富人群
    波波的个人简历
    磁盘修复工具
    9种没结果的爱(未婚者必读)!!!
    网络投机市场
    网页数据抽取的方法介绍
    C#扩展方法试用
  • 原文地址:https://www.cnblogs.com/rsapaper/p/10173510.html
Copyright © 2011-2022 走看看