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

memoizeAtLeast and memoizeBetween don't cleanup garbage-collected SoftReferences

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.1.3, 2.2.0-beta-1
    • groovy-jdk
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: