From: Garthy D Date: 2013-01-26T18:12:18+09:00 Subject: Re: Soft object reference for mark and sweep Hi Nokan, Thankyou for the input, and no, it's not silly. :) It's opened up the possibility of another approach- don't use the Hash at all, and merely dig through ObjectSpace when needed, possibly even externally to the script in some way. Combined with a cache it might form an interesting first-pass solution. In any case, it raises the question as to whether looking through things externally (ie. via ObjectSpace) could offer a potential solution. I'm not 100% sure how it'd all fit together, but it's definitely got me thinking. :) Cheers, Garth PS. I'm also relieved that my original post was understandable- it's a problem that's a little hard to explain. On 26/01/13 19:22, Nokan Emiro wrote: > Any ideas as to a good way or suitable mechanisms to implement this? > > > Just a silly one: if you seldom use that Hash in the store, you can > eliminate it. You could > still lookup your objects by iterating trough ObjectSpace and find them. > But this way the > GC will be able to drop objects if there's no reference to them. > Basically what you do here > the same old stuff: a trade off between memory and CPU. You have to > decide if lookup > speed is more important than memory footprint or the other way around. > (...or wait for a > less silly answer here... :) >