I read some article about ruby garbage collector and many mentioned about circular reference object can not be cleared.
That's absolutely not true.
Any one could give some examples of how to create a circular references?
Most trivially like this:
arr1 = []
arr2 = [ arr1 ]
arr1 << arr2
However, as I said (and as the answer to the question you linked also points out), Ruby's GC will have absolutely no problem collecting arr1
and arr2
after they go out of scope.