-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Thanks for the answer. :-)

| Ruby's GC is lazy and conservative. Lazy meaning, it does not
| exhaustively try to do path-finding on each object because for some
| objects, path-finding is an expensive process. Conservative meaning,
| if it is not doing a path-finding on an object, that object is not
| freed.
|
| Hate it or love it. It has both advantages and disadvantages. You have
| just shown a disadvantage. But it can be mitigated by exiting the
| scope which should make path-finding to those objects cheaper.

I'll search about lazy and conversative gc's. :-)
Just another question: if I use a method there, and not a begin/end block,
like this

- --------------------------------------------------------------------------
def test
	c1 = CustomObject.new("1",CustomObject.new("2",CustomObject.new("3")))
	c4 = CustomObject.new("4",CustomObject.new("5"))
	c6 = CustomObject.new("6")
	c1.next.next.next = c1	# comment this and check again
	list
end

test
GC.start			
sleep(1)
list
- --------------------------------------------------------------------------

After run this, only c6 remains. It's about scope also?

Thanks!

- ----------------------------
Eust?quio "TaQ" Rangel
eustaquiorangel / yahoo.com
http://beam.to/taq
Usu?rio GNU/Linux no. 224050
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFCzQuLb6UiZnhJiLsRAq8mAKCZdk3XkCidxwRLhxKG7unSrBIdEQCeNkMh
Im7s5zjG8umPPDkrXwwgCk0=
=2bZr
-----END PGP SIGNATURE-----