Re: weakreferences - my understanding

From: Roedy Green (see_at_mindprod.com.invalid)
Date: 04/22/04


Date: Thu, 22 Apr 2004 08:14:41 GMT

On Thu, 22 Apr 2004 08:32:59 +0200, "Filip Larsen"
<filip.larsen@nospam.dk> wrote or quoted :

>As I understand it, there is no difference in the specified GC behaviour
>for normal (non-referenced) objects and weak references, so weak
>references get cleared in same situtations where normal objects become
>garbage collected. Thisis different from soft references where
>implementations are encouraged to apply memory-cache-like behaviour in
>addition to the requirement of clearing soft references before signaling
>out-of-memory.

oops. I get these two confused often. See
http://mindprod.com/jgloss/soft.html
http://mindprod.com/jgloss/weak.html

I had this sorted out once and wrote little essays.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • Re: Can someone explain this weakref behavior?
    ... >> is more robust than simply incrementing and decrementing class variables ... >> immediately deleting the weak reference as soon as all references to the ... >> behavior of weak references? ... refcount of zero. ...
    (comp.lang.python)
  • A re-announce on GCs defects
    ... The need for weak reference makes the destruction delay logically incorrect. ... Weak references refer to references who do ... When all strong references to a target go out of their lifetime, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: nss_ldap broken
    ... I had no idea that libpthread would be loaded then unloaded. ... I'm unsure how nss_ldap was built to depend on libpthread (or ... weak references (not definitions, like you see in our libc ... By making the pthread_* references weak, you don't need to be linked ...
    (freebsd-current)
  • Re: Resolve object pointer any use for this?
    ... So, all in all a very interesting technique, but unfortunately, no good ... By the way, weak references in .NET are not needed nearly as much, because ... ObjPtr for the object as the key. ...
    (microsoft.public.excel.programming)
  • Re: INTERN hygiene in Web applications
    ... Interned chunks of rubbish will eventually be garbage collected when the only reference to the rubbish is within, say, a weak hash table of symbols. ... ANSI Common Lisp does not provide weak references nor weak hash tables. ...
    (comp.lang.lisp)