Sorry to go back to this:

On Jul 22, 7:26 pm, Romain Guy <[email protected]> wrote:
> You definitely do NOT want to use a WeakReference to cache object. If
> you do so, as soon as your data is put in the cache and not used
> outside of the cache, it gets garbage collected.

as I hope I'm merely nitpicking, but - isn't the idea that the object
*may* be GC'd anytime after/while you've discarded the last strong
(non-weak) reference to it, _perhaps_ arbitrarily later? (I say
"while" as until it is GC'd, you could make it strongly reachable
again by calling ref() on a Weak/SoftReference). I mean, I'd _guess_
it's more likely the GC will run if/when you do a lot of allocation,
and/or have a lot of idle time, or some such, tho obviously this is
not a requirement/ in the spec! Or does Dalvik use a refcounting-plus-
cycle-detection scheme, a la Bacon's "Recycler", or something like
that?

--Alan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to