From: Eric Hodel Date: 2006-08-08T09:36:14+09:00 Subject: Re: An integer's life span? On Aug 7, 2006, at 5:20 PM, Jeremy Henty wrote: > On 2006-08-07, Sam Kong wrote: > >> (1..100000).each {|i|...} >> >> Now there are 100000 integers in the memory which won't die. > > No there aren't. Immediate values don't allocate anything in memory. > [... an accurate description of class Fixnum's implementation] Also, since a Fixnum is immediate, it doesn't "have" instance variables because there's no Object to store them in. Instead they are stored somewhere else. (Where isn't terribly important.) The instance variables will consume memory, of course. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com