From: 7stud -- Date: 2009-04-30T19:08:31+09:00 Subject: Re: object scope and cleanup Joshua Ball wrote: > I am having trouble understanding Ruby object cleanup wrt scope. In > particular, I would think that an object is getting deleted, but it > turns out that is not the case. In a language like C++, out_of_scope == destruction With garbage collectors, out_of_scope == ready_for_destruction When the object is destroyed and whether the object is ever destroyed, is out of your hands. It may be the case that the gc never sees a need to destroy the object, in which case the object gets wiped out of memory only when your program ends and the operating system reclaims the program's resources(and I believe even then it's still in memory!). There is another current thread where the ruby gc is being discussed: http://www.ruby-forum.com/topic/185559#new -- Posted via http://www.ruby-forum.com/.