On 10/1/06, FaeLLe <[EMAIL PROTECTED]> wrote:
Perhaps he means clone the object to a WeakReference then null the original
object ?
That way the only existing copy of that object will be a WeakReference....
with my limited
understanding of GC concepts would that no be benificial ?
Regards,
- Vikram Mohan
WeakReference can become null any time. We hold strong reference for a
reason. Usually algorithms assume that there is no possibility to
loose the object we hold at any arbitrary point. With the conversion,
the assumption will fail.
If we had a way to re-create the state of given object after we have
GC'd him, we could use the WeakReferences. But, anyway, I have serious
doubts about any performance gain with the approach for _short_living_
objects. Short living object, AFAIU, is objects which are created,
initialized, used, and unused any more.
Explicit zeroing of no-longer-used references can be benefitial for
GC. This is nothing to do with the WeakReferences.
--
Ivan
Intel Middleware Products Division
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]