RFR (s): 8153755: Improve test: stress/gc/TestStressRSetCoarsening.java
dmitry.fazunenko at oracle.com
Tue Apr 12 13:32:00 UTC 2016
Thank you for your notices!
Please find some comments inline:
On 12.04.2016 15:14, Kirill Zhaldybin wrote:
> 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) *
Yes, I modified as you suggested.
I kept used/totalFree to print information about system.
> 2. You could calculate actual Object[N] size without loop - see
> gc/testlibrary/Helpers.java detectByteArrayAllocationOverhead as example.
The Helper class seems to do what's needed, but it deals for byte,
when I work with Object. So, to use the Helper I will have to write an
I prefer to keep my implementation as is, which is relatively simple.
> Thank you.
> Regards, Kirill
> On 11.04.2016 16:09, Dmitry Fazunenko wrote:
>> 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
>> Testing: locally + RBT
More information about the hotspot-gc-dev