• Ben Gamari's avatar
    NonMoving: Don't do major GC if one is already running · 1d7b6fac
    Ben Gamari authored
    Previously we would perform a preparatory moving collection, resulting
    in many things being added to the mark queue. When we finished with this
    we would realize in nonmovingCollect that there was already a collection
    running, in which case we would simply not run the nonmoving collector.
    
    However, it was very easy to end up in a "treadmilling" situation: all
    subsequent GC following the first failed major GC would be scheduled as
    major GCs. Consequently we would continuously feed the concurrent
    collector with more mark queue entries and it would never finish.
    
    This patch aborts the major collection far earlier, meaning that we
    avoid adding nonmoving objects to the mark queue and allowing the
    concurrent collector to finish.
    1d7b6fac
NonMoving.h 11.2 KB