harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Volosyuk" <ivan.volos...@gmail.com>
Subject Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.
Date Mon, 02 Oct 2006 10:07:26 GMT
On 10/1/06, FaeLLe <mrbillcollector@gmail.com> 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.

Intel Middleware Products Division

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message