[concurrency-interest] Memory sensitive memoization

Blair Zajac blair at orcaware.com
Mon Jun 27 11:47:59 EDT 2011


On Jun 27, 2011, at 5:04 AM, Doug Lea wrote:

> On 06/27/11 02:57, Sanchay Harneja wrote:
>> On a side note, from my little testing I get the impression that weak refs are
>> too aggressively garbage collected, whereas soft refs are only collected at the
>> very last moment (effectively crawling the application when memory limit is
>> hit).  Both don't work for our application. Think I would need a more
>> comprehensive caching strategy.
> 
> Yes. A "Cache" is basically an enhanced concurrent map with
> an expiration policy. There are enough possibilities for how
> to expose and support expiration to have led us to stall for
> years on releasing one. We will revisit this for jdk8.
> In the mean time, guava MapMaker is a reasonable choice
> for many usages.

As MapMaker has recently added support for specifying a maximum cache size and a #expireAfterAccess() method, are there other missing features you would want to see in jdk8?

Regards,
Blair




More information about the Concurrency-interest mailing list