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

Jon Masamitsu jon.masamitsu at oracle.com
Fri Mar 1 17:54:27 UTC 2013


Erik,

I'm going to have to straighten some things out in my
head before I respond.  There is more than a little confusion
in the use of the term capacity I think so please
bear with me.

Jon

On 2/27/2013 9:07 AM, Erik Helin wrote:
> Jon,
>
> On 02/20/2013 05:54 PM, Jon Masamitsu wrote:
>>
>> 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.
>
> I have changed the code to:
>
> size_t committed = 
> align_size_down_(MetaspaceAux::capacity_in_bytes(_md_type), 
> os::vm_page_size());
>
> Is that what you meant?
>
> A new webrev can be found at:
> http://cr.openjdk.java.net/~ehelin/8000754/webrev.02/
>
> Thanks,
> Erik
>
>> 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