From: brabuhr@... Date: 2010-08-28T03:34:56+09:00 Subject: [ruby-core:31904] Re: Garbage Collection Question On Fri, Aug 27, 2010 at 2:04 PM, Asher wrote: > Trying your example 1000 times simply loops infinitely on my ruby. Not sure why. > > Trying it 10.times and then 2.times works - throws expected error on first attempt to retrieve. > > Trying it 1.times does not - returns uncollected object. > > Your example of 1000 times causes it to work on the 33rd try. > > What gives? or is your point that there is no way to predict this? If that's the case, why does it work the first time consistently with my attempts 2.times, 10.times, etc.? Beats me :) ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] Linux 2.6.32 Ubuntu i686 GNU/Linux I consistently see no RangeError until 34.times then none until 38.times: 34.times RangeError when n = 0 38.times RangeError when n = 0 40.times RangeError when n = 38 43.times RangeError when n = 0 44.times RangeError when n = 42 46.times RangeError when n = 0 47.times RangeError when n = 42 48.times RangeError when n = 0 49.times RangeError when n = 38 50.times RangeError when n = 42 52.times RangeError when n = 38 53.times RangeError when n = 42 55.times RangeError when n = 38 56.times RangeError when n = 42 58.times RangeError when n = 38 59.times RangeError when n = 42 61.times RangeError when n = 0 ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-linux] Linux 2.6.18 i686 i686 i386 GNU/Linux 34.times RangeError when n = 0 35.times RangeError when n = 33 36.times RangeError when n = 33 38.times RangeError when n = 0 39.times RangeError when n = 0 40.times RangeError when n = 33 41.times RangeError when n = 38 43.times RangeError when n = 0 44.times RangeError when n = 0 45.times RangeError when n = 38 46.times RangeError when n = 0 47.times RangeError when n = 33 48.times RangeError when n = 0 49.times RangeError when n = 38 50.times RangeError when n = 47