Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4129862

Respecify soft references, remove guarded references and the memory-advice API

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.2.0
    • 1.2.0, 1.3.0
    • core-libs
    • None
    • 1.2beta4
    • generic
    • generic
    • Not verified

      Soft references (java.lang.ref.SoftReference) and the memory-advice API upon
      which they are based (java.lang.Runtime.MemoryAdvice etc.) have proven to be
      unworkable in their present form. Soft references are not always cleared in
      time to prevent OutOfMemoryErrors from being thrown. They are also not cleared
      as aggressively as they are by the 1.1 VM, thereby contributing to the
      memory-footprint bloat we're seeing with 1.2.

      The problems with soft references are due largely to the fact that they are
      implemented atop the memory-advice API, which is fundamentally incapable of
      ensuring the close cooperation between the garbage collector and Java-level
      cleanup threads that is necessary to implement memory-sensitive structures such
      as soft references. A better way to implement soft references is to wire them
      directly into the GC, just like the other reference-object types.

      Finally, further discussion of the SoftReference class itself has led to a
      revised specification that, unlike the present specification, clearly describes
      what is and is not guaranteed and can therefore be used as the basis of an
      effective JCK test.

      -- mr@eng 4/16/1998

            mr Mark Reinhold
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: