<< Back to previous view

[CCACHE-5] Implement SoftCache Created: 06/Dec/11  Updated: 13/Jul/12  Resolved: 19/Jun/12

Status: Resolved
Project: core.cache
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Fogus Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: File mutable-soft-cache.diff    


Clache had a buggy implementation of a cache backed by soft references. This capability should be explored further and implemented properly for core.cache.

Comment by Paul Stadig [ 04/Jun/12 10:20 AM ]

I'd be interested in taking a crack at this, but would find it useful to have more infos about what bugs existed in the Clache implementation.

Comment by Paul Stadig [ 16/Jun/12 8:14 AM ]

I've implemented a mutable SoftCache. I felt as though the tradeoffs made it worth using a ConcurrentHashMap as the base for SoftCache.

SoftReference objects are mutable (and tied to a specific instance of ReferenceQueue). ReferenceQueue is mutable. Using an immutable map as the base for SoftCache would cost {O(n)} when removing cleared SoftReference objects from the cache.

If immutability is desirable, I also have an implementation of an immutable SoftCache, but it suffers from the above {O(n)} cost.

Comment by Fogus [ 19/Jun/12 6:53 AM ]

I have no problem with internal mutability in the cache impls, so that immutable code might not be needed. I've pushed the 0.7.0-SNAPSHOT version with your additions and will run it through the paces post-haste. Thank you for tackling this Paul, it's a huge help.

Comment by Fogus [ 19/Jun/12 6:54 AM ]

Planned for v0.7.0

Comment by Fogus [ 13/Jul/12 10:47 AM ]

Actually released in version 0.6.1.

Generated at Sun Jan 21 03:10:48 CST 2018 using JIRA 4.4#649-r158309.