RFR (XS): 8005108: NPG: Add specialized Metachunk sizes for reflection and anonymous classloaders

Stefan Karlsson stefan.karlsson at oracle.com
Tue Dec 18 16:45:40 UTC 2012


On 18 dec 2012, at 17:30, Jon Masamitsu <jon.masamitsu at oracle.com> wrote:

> 
> 
> On 12/18/12 04:16, Stefan Karlsson wrote:
>> On 12/18/2012 11:47 AM, Bengt Rutisson wrote:
>>> 
>>> Hi Stefan,
>>> 
>>> Looks good to me.
>>> 
>>> I think this comment in metaspace.cpp can also be removed:
>>> 
>>> 2220 // The total words available for metadata allocation.  This
>>> 2221 // uses Metaspace capacity_words() which is the total words
>>> 2222 // in chunks allocated for a Metaspace.
>> 
>> My change just reverses some of the changes in 3854. This comment was already wrong before that change.
>> 
>> Jon, do you think I should remove or reword the comment.
> 
> Please remove the comment.  The name of the method is
> descriptive enough.
> 
> Thanks.
> 
> Also, change looks good.

OK.

thanks,
StefanK

> 
> Jon
> 
>> 
>> thanks,
>> StefanK
>> 
>>> Bengt
>>> 
>>> On 12/18/12 11:02 AM, Stefan Karlsson wrote:
>>>> http://cr.openjdk.java.net/~stefank/8005108/webrev.00/
>>>> 
>>>> Description from the bug:
>>>> ---
>>>> The implementation of MetaspaceAux::used_in_bytes(), capacity_in_bytes() and reserved_in_bytes() changed as part of this changeset:
>>>> 
>>>> changeset: 3854:90273fc0a981
>>>> user: coleenp
>>>> date: Thu Nov 29 16:50:29 2012 -0500
>>>> summary: 8000662: NPG: nashorn ant clean test262 out-of-memory with Java heap
>>>> 
>>>> Before this change it seems like data + classes = total. After this does not seem to hold.
>>>> 
>>>> This can be verified by running a simple test that does System.gc() with -XX:+PrintHeapAtGC:
>>>> 
>>>> Change 3853:
>>>> 
>>>> Metaspace total 3400K, used 2760K, reserved 108544K
>>>>  data space 3076K, used 2477K, reserved 6144K
>>>>  class space 324K, used 283K, reserved 102400
>>>> 
>>>> 
>>>> Change 3854:
>>>> 
>>>> Metaspace total 3400K, used 3400K, reserved 108544K
>>>>  data space 3076K, used 2476K, reserved 6144K
>>>>  class space 324K, used 283K, reserved 102400K
>>>> 
>>>> In this example capacity and reserved add up, but used does not. I have seen cases where at least capacity also did not add up.
>>>> ---
>>>> 
>>>> This patch reverts back to the old implementation. We probably want a better way to count these values, but right now we need consistent numbers.
>>>> 
>>>> StefanK
>>> 
>> 



More information about the hotspot-gc-dev mailing list