has anyone seen a use of ruby's WeakRef in the wild? what was it used for? I'm having trouble imagining a use case
IIRC that was from Java and used in a lot oc caching algorithms where you’re adding a weakref so that the GC can grab it when memory is low, and works to remove stale objs from the cache. I think it also helped a few GC edge cases in Ruby.
-
-
I was thinking they used SoftReference in Java? or at least I'd reach for that before WeakReference
-
Keep in mind my Java is ancient history. They probably fumbled at 10 possible solutions and Ruby borrowed that one.
- 1 more reply
New conversation -
-
-
You know what I can never remember correctly? What the acronym IIRC means. I have to look it up every damn time.
#ironyThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.