groovy/groovy-core — pull request #128 by luque (2013-01-25 21:44:05+00:00)
Title: [GROOVY-5948]  memoizeAtLeast and memoizeBetween don't cleanup garbage-collected SoftReferences

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.