[CLJ-746] Unreference keywords not correctly removed from keyword table (Utils.clearCache) Created: 25/Feb/11 Updated: 04/Mar/11 Resolved: 04/Mar/11
|Affects Version/s:||Release 1.3|
I just ran into http://dev.clojure.org/jira/browse/CLJ-444 in clojure 1.2 and think the anlaysis there missed the cause of the issue.
Reading http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ref/ReferenceQueue.html#poll() suggests poll removes an item from the queue.
In Util.clearCache, there are two calls to rq.poll() with discarded return values, with the result that some of the enqueued soft references are not being removed from cache (ie the keyword table)
|Comment by Stuart Halloway [ 04/Mar/11 9:49 PM ]|
The references do not need to be removed using the queue. They can be (and are) removed by directly walking the values of the map. The queue serves only to notify that this work needs to be done.