Well, there are a lot of advantage (Concurrency, usability, clean API, ...)
but for me the most important one is:
With MapMaker and SoftReference you remove all case of OOME for wrongly
configured cache.
Finding the sweet numbers for your cache is humanly impossible. There are
too many variables changing too often (Domain model objects, DB setup,
Memory, CPU, Network, I/O, User behavior, holidays, big working days, ...)
So, when you need more performance, you always increase the number of
objects in cache until you get OOME !
Then you call support: There is a memory leak!
Answer: It's not a leak, it's a voluntary accumulation of memory => Wrongly
configured cache

Now moving to SoftReferences: Your cache will NEVER be the reason for your
OOME, and the configuration using -XX:SoftRefLRUPolicyMSPerMB=25000 is a lot
easier to get the sweet spot.

Actually, the best configuration I'm looking for is a google collection map
where the first 200 (or configurable number) LRU are HardReference and all
the rest is SoftReference.
I'm looking for this, because when the system get into memory stress,
garbage collecting highly used cached object make it sometimes impossible to
recover to normal mode.

To be continued...

On Sat, Apr 11, 2009 at 3:00 AM, Eishay Smith <[email protected]> wrote:

>
> Anyone has some numbers comparing MapMaker based cache and other types
> of caches (ehcache, memcached)?
> >
>


-- 
http://www.jfrog.org/
http://freddy33.blogspot.com/
http://nothingisinfinite.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to