RFR (s): 8153755: Improve test: stress/gc/TestStressRSetCoarsening.java

Kirill Zhaldybin kirill.zhaldybin at oracle.com
Tue Apr 12 12:14:22 UTC 2016


Dmitry,

Just a couple of remarks:
1. You could get a number of free regions with WhiteBox method:
regionCount = (int) WB.g1NumFreeRegions();

It should be more reliable (and simpler) than
         // How many free regions
         Runtime rt = Runtime.getRuntime();
         long used = rt.totalMemory() - rt.freeMemory();
         long totalFree = rt.maxMemory() - used;
         regionCount = (int) ((totalFree / regionSize) * 
heapFractionToAllocate);

2. You could calculate actual Object[N] size without loop - see 
gc/testlibrary/Helpers.java detectByteArrayAllocationOverhead as example.

Thank you.

Regards, Kirill


On 11.04.2016 16:09, Dmitry Fazunenko wrote:
> Hello,
>
> May I have a couple of reviews for a small change to the stress test:
>
> 1) change logging options (-XX:+PrintGC --> -Xlog:gc*)
> 2) Use WhiteBox API to obtain size of new Object[N] object
>
>
> https://bugs.openjdk.java.net/browse/JDK-8153755
> http://cr.openjdk.java.net/~dfazunen/8153755/webrev.00/
>
> Testing: locally + RBT
>
> Thanks,
> Dima
>
>
>




More information about the hotspot-gc-dev mailing list