Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5948

memoizeAtLeast and memoizeBetween don't cleanup garbage-collected SoftReferences

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.3, 2.2.0-beta-1
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      Both Closure's methods memoizeAtLeast() and memoizeBetween() try to implement a memory-sensitive cache using SoftReference to the memoized values. However studying the iplementation I've noted that the SoftReference instances are not being registered with the ReferenceQueue, so when these SoftReferences are cleared by GC are not being removed from memoization cache.

        Attachments

          Activity

            People

            • Assignee:
              pschumacher Pascal Schumacher
              Reporter:
              rluque Rafael Luque
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: