I believe the lock strategy in ehcache is hashcode based -- the hashcode
of the key determines the lock ID. I don't think there is a user facing
(ie. ehcache.xml) way to change the lock strategy, but the underlying CDM
supports differing strategy implemenatations.

Active locks are in memory but they are much smaller in recent TC releases
(like 3.2.1 for example). Chris would know better than I would, but I
think locks are in memory for any keys read/put by that VM and for which
the value is not flushed. Any other locks should be GC'd.

> -----Original Message-----
> From: tc-dev-boun...@lists.terracotta.org [mailto:tc-dev-
> boun...@lists.terracotta.org] On Behalf Of Sergio Bossa
> Sent: Wednesday, April 28, 2010 7:27 AM
> To: tc-dev@lists.terracotta.org
> Subject: Re: [tc-dev] Memory problems with
> com.tc.objectserver.locks.LockStore
>
> Okay, switched tim-concurrent-collections from 1.3.1 to 1.3.2 as
> previously suggested by David (thanks!), and now everything is much
> more stable:
> 1) I don't get OOM errors anymore.
> 2) LockStore memory footprint is reduced: more specifically, there are
> fewer lock objects.
>
> So, my problem seems to be resolved, but I'm curious now :)
> I'd greatly appreciate if someone may take the time to answer a few
> questions:
> 1) What's ehcache default locking strategy? Now that it uses far more
> locks, I'd say it doesn't create one lock per element, or am I wrong?
> 2) Are all locks still completely held in memory? If so, would using
> one lock per element (one-to-one) strategy saturate memory?
>
> Thanks much,
> Cheers!
>
> Sergio B.
>
> On Wed, Apr 28, 2010 at 3:00 PM, Sergio Bossa <sergio.bo...@gmail.com>
> wrote:
> > On Wed, Apr 28, 2010 at 2:57 PM, David Reines <dhrei...@gmail.com>
> wrote:
> >
> >> I believe this fix requires an upgrade to tim-concurrent-collections
> to
> >> 1.3.2 as well.  Not sure if it's part of the patch.
> >
> > No, it isn't: I'll try with that one (even if I still don't get how
> it
> > could reduce the LockStore footprint).
> > Thanks much,
> >
> > Sergio B.
> >
> > --
> > Sergio Bossa
> > http://www.linkedin.com/in/sergiob
> >
>
>
>
> --
> Sergio Bossa
> http://www.linkedin.com/in/sergiob
> _______________________________________________
> tc-dev mailing list
> tc-dev@lists.terracotta.org
> http://lists.terracotta.org/mailman/listinfo/tc-dev
_______________________________________________
tc-dev mailing list
tc-dev@lists.terracotta.org
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to