On 9/18/06, Oliver Deakin <[EMAIL PROTECTED]> wrote:
Xiao-Feng Li wrote:
> On 9/14/06, Jimmy, Jing Lv <[EMAIL PROTECTED]> wrote:
>> Interesting topic, I'm still dreaming of "free()" in Java (This dream
>> begins at the very beginning when I see Java, as C/C++ is my first
>> program language )However, it seems RI will never give us "free()". :)
>>
>> Only a thought, Java may offer a key word "temp", indicating that this
>> variety can be freed at once.
>
>
> Well, it is not so easy to support "free()" in JVM as it looks like,
> and may not really bring benefit. Even worse, it may introduce unsafe
> code, which was one of the major design goals of Java/JVM. That said,
> I agree that some hints by programmer to assist GC might be an
> interesting topic.

There are always weak references to help out with short lived objects -
you know they will be collected fairly soon (should be within a few
gc cycles) - and soft references for longer lived ones. That's
about as close to free() as youll get for now!

Regards,
Oliver


I don't understand. How can weak references help short-lived objects reclaim?

Thanks,
xiaofeng

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to