RFR: 8000754: NPG: Implement a MemoryPool MXBean for Metaspace

Jon Masamitsu jon.masamitsu at oracle.com
Wed Feb 20 16:54:18 UTC 2013


On 2/20/2013 4:42 AM, Stefan Karlsson wrote:
> Hi Erik,
>
> This fix seems reasonable to me.
>
> http://cr.openjdk.java.net/~ehelin/8000754/webrev.01/src/share/vm/services/memoryPool.cpp.udiff.html 
>
>
> +MemoryUsage MetaspacePoolBase::get_memory_usage() {
> +  size_t used = MetaspaceAux::used_in_bytes(_md_type);
> +  size_t committed = MetaspaceAux::capacity_in_bytes(_md_type);
> +  return MemoryUsage(initial_size(), used, committed, max_size());
> +}
>
> I'm not sure if capacity is the right value to use for committed, so 
> you'll need to verify that with Jon.

In general we only commit memory when we allocate a chunk for that
memory so this is mostly correct.  The exception is that the allocation of
a chunk smaller than a page can will cause more than the chunk size to
be committed.  I think this is the right value to use modulo a page size.

Jon
>
> thanks,
> StefanK
>
> On 02/20/2013 12:02 PM, Erik Helin wrote:
>> Hi,
>>
>> this change implements a new MemoryManagerMXBean, MetaspaceManager, as
>> well as two new MemoryPoolMXBeans: Metaspace and Class Metaspace. I have
>> also written a tests that tests the new beans.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~ehelin/8000754/webrev.01/
>>
>> Bug:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8000754
>>
>> Testing:
>> JPRT
>> New jtreg test
>>
>> Thanks,
>> Erik
>




More information about the hotspot-gc-dev mailing list