[PATCH] 8037925: CMM Testing: an allocated humongous object at the end of the heap should not prevents shrinking the heap

Igor Ignatyev igor.ignatyev at oracle.com
Thu Mar 27 22:24:39 UTC 2014


Andrey,

>> Most probably I forgot TEST.groups again...
yeap, you did.

>>> - I can't find MemoryUsagePrinter class in testlibrary[1]
>> It is in webrev: http://cr.openjdk.java.net/~jwilhelm/8037924/webrev/
how should I know about it? you didn't mention about it in your RFR

>>> - please replace string constant, which use in MemoryUsagePrinter, by
>>> enum
You don't need to use enum here and string constant (Labels.*) in 
TestDynShrinkHeap. I've mistakenly think that MemoryUsagePrinter uses 
String argument to change its own behavior. Sorry for useless extra work.

>>> - lines 79,82: why did you use
>>> sun.management.ManagementFactoryHelper.getDiagnosticMXBean() instead
>>> of 'ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class)' ?
>> Are we talking about this?
>>              throw new RuntimeException(
>>                      String.format("committed free heap size is not less
>> than committed full heap size, heap hasn't been shrunk?%n"
>>                              + "%s = %s%n%s = %s",
>>                              MinFreeRatioFlagName,
>> ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class).
>> getVMOption(MinFreeRatioFlagName).getValue(),
>>                              MaxFreeRatioFlagName,
>> ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class).
>> getVMOption(MaxFreeRatioFlagName).getValue()
>>                      )
yes, we're.

please, use generics in 54,65 lines:
> 54     private static final List garbage = new ArrayList();
> 65             List stuff = new ArrayList();
and then, you won't have to use cast in line 95:
>  95         ArrayList stuff = ((ArrayList) garbage.get(garbage.size() - 1));

>   26  * @key gc
why do you need this?

>   64         for (int i = 0; i < 5; i++) {
magic number '5'

>  61         int humonSize = Math.round(1f * PageSize);
I'd prefer '1.0f', but it's only my fad, it's not necessary to change.

Thanks
Igor

On 03/27/2014 04:37 PM, Andrey Zakharov wrote:
> Hi, here is updated webrev:
> http://cr.openjdk.java.net/~jwilhelm/8037925/webrev.02/
> Most probably I forgot TEST.groups again...
>
>
> On 26.03.2014 23:12, Igor Ignatyev wrote:
>> Hi Andrey,
>>
>> - I can't find MemoryUsagePrinter class in testlibrary[1]
> It is in webrev: http://cr.openjdk.java.net/~jwilhelm/8037924/webrev/
>> - please replace string constant, which use in MemoryUsagePrinter, by
>> enum
>> - you forgot to remove commented line 53 Hi
> Done
>> - lines 79,82: why did you use
>> sun.management.ManagementFactoryHelper.getDiagnosticMXBean() instead
>> of 'ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class)' ?
> Are we talking about this?
>              throw new RuntimeException(
>                      String.format("committed free heap size is not less
> than committed full heap size, heap hasn't been shrunk?%n"
>                              + "%s = %s%n%s = %s",
>                              MinFreeRatioFlagName,
> ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class).
> getVMOption(MinFreeRatioFlagName).getValue(),
>                              MaxFreeRatioFlagName,
> ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class).
> getVMOption(MaxFreeRatioFlagName).getValue()
>                      )
>              );
>>
>> - just a nit: you again use extra spaces in some brackets: 55,68,61,74,..
> Done
> Thanks.
>>
>> [1]
>> http://hg.openjdk.java.net/jdk9/hs-gc/hotspot/file/tip/test/testlibrary/com/oracle/java/testlibrary
>>
>>
>> Thanks,
>> Igor
>>
>> On 03/26/2014 11:02 PM, Andrey Zakharov wrote:
>>> Test to check, that if we allocate h1, h2 and h3 humongous objects and
>>> free h1 and h2, after GC G1 shrinks the heap.
>>> webrev: http://cr.openjdk.java.net/~jwilhelm/8037925/webrev/
>>> bug: https://bugs.openjdk.java.net/browse/JDK-8037925
>>>
>>> This test used testlibrary MemoryUsagePrinter from
>>> http://cr.openjdk.java.net/~jwilhelm/8037924/webrev/
>>>
>>> Thanks.
>>>
>



More information about the hotspot-gc-dev mailing list