2

As we known, *Reference Counter*, *Mark-Sweep*, *Mark-Copy* are three GC algorithms using most widely in programming languages. I used to believe that Reference Counter is the only GC algorithm that python use. Recently, however, when I planned to learn further about Python's GC mechanism I came across an article titled *Principle of Python garbage collector and its application*. The author talked about all of the three kinds of GC algorithms in his paper without pointing out which algorithm(or algorithms) does python actually use. Then I turned to the search engine as well as several domestic forums about python hoping to find a specific answer, failed. Results were even more confusing. Until now, I'm still unsure which kind of GC algorithms does python use? If Reference Counter was actually used, how to solve the trouble of *Circular Reference* and *Mutual Reference*?

streethacker
  • 308
  • 5
  • 13
  • May be these articles will help: 1. [Visualizing Garbage Collection in Ruby and Python](http://patshaughnessy.net/2013/10/24/visualizing-garbage-collection-in-ruby-and-python) 2. [Generational GC in Python and Ruby](http://patshaughnessy.net/2013/10/30/generational-gc-in-python-and-ruby) – Neo Ko Feb 21 '14 at 12:09

0 Answers0