[infinispan-dev] JBoss Libra

Dan Berindei dan.berindei at gmail.com
Tue Jan 31 15:51:04 EST 2012


On Tue, Jan 31, 2012 at 4:49 PM, Bela Ban <bban at redhat.com> wrote:
> I don't know, but I don't see why not.
>
> If you look at java.lang.{Memory,GarbageCollector,MemoryPool}, there are
> a lot of values you can look at, including the details on eden and old.
>

I just looked at G1 with JConsole, it does provide memory usage
information in (java.lang:type=MemoryPool, name={G1 Young Gen, G1
Survivor, G1 Old Gen}).Usage. However, the locations are not standard,
so we'd have to keep a bunch of rules about where to look for each
garbage collector.

Plus I'm not sure what looking at each generation separately would buy
us over looking only at Runtime.freeMemory().

> You can even register for notifications when free memory drops below a
> certain threshold, but I've never tried this out and I heard some impls
> don't provide this...
>

The biggest problem I think with looking at the amount of used/free
memory is used memory includes dead objects. So you'll get a free
memory threshold notification and start evicting entries, but you
won't know how much memory you've freed (or even if you needed to
evict any entries in the first place) without triggering an extremely
expensive full GC.

I second Mircea's idea of using the serialized data size, that's the
only reliable data we've got.

Cheers
Dan


>
> On 1/31/12 3:32 PM, Tristan Tarrant wrote:
>> On 01/31/2012 03:32 PM, Bela Ban wrote:
>>> IIRC you can look at the size of the young and old generation via JMX,
>>> and there you can see how much memory has accumulated.
>> Does that work when using G1 ?
>>
>> Tristan
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
> --
> Bela Ban
> Lead JGroups (http://www.jgroups.org)
> JBoss / Red Hat
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


More information about the infinispan-dev mailing list