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

Erik Helin erik.helin at oracle.com
Thu Feb 21 15:57:03 UTC 2013


thanks for the review!

On 02/21/2013 05:22 AM, Jon Masamitsu wrote:
> Erik,
> These changes look good.


On 02/21/2013 05:22 AM, Jon Masamitsu wrote:
> used_in_bytes() and capacity_in_bytes() do run
> over the classloader data graph and as such
> are not free to call.  I generally think to use them
> in assertion checking or where I don't expect
> them to be executed much.  Here I expect they
> are executed in response to some type of
> intermittent query.  If you think they will be
> executed continuously, we should talk about
> the alternatives.

Thanks, I didn't know that used_in_bytes() and capacity_in_bytes() were
expensive. I looked at the consumers of the 
and it is executed due to a couple of reasons:
- From Java:
   - MemoryMXBean.getHeapMemoryUsage()
   - MemoryMXBean.getNonHeapMemoryUsage()
   - MemoryPoolMXBean.getUsage()
- From the VM:
   - At the start and end of GC to provide different *MXBeans with the
     memory usage before and after a GC.
   - Bookkeeping to support the *MXBeans with low memory detection as
     well as peak memory usage.

Do you think that they methods are too expensive for this kind of usage?


> Jon
> On 2/20/2013 3:02 AM, 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:
>> New jtreg test
>> Thanks,
>> Erik

More information about the hotspot-gc-dev mailing list