From: Caio Tiago Oliveira Date: 2005-05-23T04:04:28+09:00 Subject: Re: Doubt about GC Eustaquio Rangel de Oliveira Jr., 16-05-2005 17:19: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Lothar! > > | Unlikely but the stack marking is conservative. Maybe there is > | something on the stack that looks like a pointer to Car no.4. In this > | event Car no.4 will not be deleted. > > Kind of some "memory dirty" or something like that? I'm in such a different hardware and I got a result somehow different in ruby1.8 and ruby1.9. I've HT enabled and running the code in both versions left cars 1, 4 and 5 after GC. If I sleep a lot of time (I've tried uo to 10 sec), in ruby1.8 it still left the three cars and in ruby1.9 only cars 1 and 5. $ ruby --version ruby 1.8.2 (2005-04-11) [i386-linux] $ruby Car.rb Creating car no. 1:-604682514 Creating car no. 2:-604682524 Creating car no. 3:-604682564 Listing cars: Car no. 3:-604682564 Car no. 2:-604682524 Car no. 1:-604682514 Creating car no. 4:-604682654 Creating car no. 5:-604682644 Listing cars: Car no. 4:-604682654 Car no. 5:-604682644 Car no. 3:-604682564 Car no. 2:-604682524 Car no. 1:-604682514 Sleeping... Firing gc. Listing cars: Car no. 5:-604682644 Car no. 1:-604682514 todos@tiago:~/caio/prog/ruby$ ruby1.8 Car.rb Creating car no. 1:-604583790 Creating car no. 2:-604583800 Creating car no. 3:-604583840 Listing cars: Car no. 3:-604583840 Car no. 2:-604583800 Car no. 1:-604583790 Creating car no. 4:-604583930 Creating car no. 5:-604583920 Listing cars: Car no. 4:-604583930 Car no. 5:-604583920 Car no. 3:-604583840 Car no. 2:-604583800 Car no. 1:-604583790 Sleeping... Firing gc. Listing cars: Car no. 4:-604583930 Car no. 5:-604583920 Car no. 1:-604583790 and $ ruby1.9 --version ruby 1.9.0 (2005-04-12) [i386-linux] $ruby1.9 Car.rb Creating car no. 1:-604682514 Creating car no. 2:-604682524 Creating car no. 3:-604682564 Listing cars: Car no. 3:-604682564 Car no. 2:-604682524 Car no. 1:-604682514 Creating car no. 4:-604682654 Creating car no. 5:-604682644 Listing cars: Car no. 4:-604682654 Car no. 5:-604682644 Car no. 3:-604682564 Car no. 2:-604682524 Car no. 1:-604682514 Sleeping... Firing gc. Listing cars: Car no. 5:-604682644 Car no. 1:-604682514