From: "Kroeger Simon (ext)" Date: 2005-08-11T17:23:18+09:00 Subject: Re: force_recycle Hi Nobu, i realy appreciate your input but that's not the kind of problem I'm facing (and I probably should have elaborated the issue further when asking such questions). At one point in our project a large number of plain ruby objects gets alocated (no relation to external resources) and stored in an array (all of the same class). This happens from various Threads but in a (hopefully) threadsafe manner. Later this array gets #clear(ed). After GC there are still instances of the class in the ObjectSpace even though this special class is only used for elements of this array. This process repeats itself over and over again and after some hours we have hundreds of MB memory leak. So, what I'm realy looking for is a way to ask: 'hey almighty shepherd of objects, why are you still clinging to xyz?' Simon > -----Original Message----- > From: nobuyoshi nakada [mailto:nobuyoshi.nakada@ge.com] > Sent: Thursday, August 11, 2005 3:29 AM > To: ruby-talk ML > Subject: Re: force_recycle > > Hi, > > At Thu, 11 Aug 2005 00:16:10 +0900, > Kroeger Simon (ext) wrote in [ruby-talk:151514]: > > but that's ok. I have a rather large project here and it is eating > > memory. I thought it would be nice to delete the objects we > think are > > obsolet and see where it goes down. > > The wrong thing is that you misuse GC to maintain expensive > (or external) resources. Use a releasing method and blocks to > ensure they get called. > > > http://www.rubyist.net/~matz/slides/oscon2005/mgp00047.html > http://www.rubyist.net/~matz/slides/oscon2005/mgp00048.html > http://www.rubyist.net/~matz/slides/oscon2005/mgp00049.html > > -- > Nobu Nakada > >