[concurrency-interest] jsr166y classes now in jdk7m5

Bryan Thompson bryan at systap.com
Mon Nov 16 12:02:06 EST 2009


Bob,

I posted a little while ago looking for a concurrent LRU (or similar eviction policy).  I am looking at the 1.0-rc4 download of the google collections[1].  Looking at MapMaker, I see support for time-based eviction.  However, what we really want is support for access-based eviction orders which are triggered based on the RAM utilized by the cache so we can manage the cache size in terms of the percentage of the heap which is dedicated to buffering data.  Our application is a clustered database.   There is really no reason to evict records from the cache just because they are old since the cache would just become "cold".  Instead, we would like to preserve records in the cache and evict them when the cache would exceed a configured memory limit.

I've done several implementations of this, but none of them are based on striped locking or non-blocking operations which limits their potential concurrency.  I've improved performance of a blocking cache implementation significantly by doing many evictions at once when the cache is full (cheap hack to reduce the lock contention), but I would really love to find a high performance concurrent cache with a pluggable eviction policy.  Am I just missing how to do this with MapMaker?  If I can do this with MapMaker, I would definately be happy to provide feedback on the implementation and its performance.

Thanks,

-bryan

[1] http://code.google.com/p/google-collections/

________________________________
From: concurrency-interest-bounces at cs.oswego.edu [mailto:concurrency-interest-bounces at cs.oswego.edu] On Behalf Of Bob Lee
Sent: Monday, November 16, 2009 11:07 AM
To: Alex Miller
Cc: Martin Buchholz; Doug Lea; concurrency-interest at cs.oswego.edu
Subject: Re: [concurrency-interest] jsr166y classes now in jdk7m5

Alex,

I've been working on MapMaker full time for the past 2 weeks and do hope to get it into JDK 7. It will have simple LRU-based (possibly combined w/ LFU-based) eviction. You won't be able to plug in custom eviction algorithms, but it will make a for an effective, fast, concurrent, general-purpose, in-memory cache that will improve upon soft references without sacrificing ease of use. I liken it to LinkedHashMap.removeEldest().

I understand that the JDK 7 schedule is kind of up in the air at the moment, but Doug and Martin are right--if MapMaker doesn't make it in, it's not the end of the world. We can just continue to import Google Collections.

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20091116/16cec22d/attachment.html>


More information about the Concurrency-interest mailing list