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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.3.0
    • Fix Version/s: 1.2.0
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      1.2beta4
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: