[8u60] RFR (XS): 8076325: java hangs with -XX:ParallelGCThreads=0 -XX:+ExplicitGCInvokesConcurrent options

Stefan Karlsson stefan.karlsson at oracle.com
Fri Apr 10 07:47:35 UTC 2015


On 2015-04-09 18:50, Sangheon Kim wrote:
> Hi Stefan,
>
> Thank you for the review.
>
> On 04/09/2015 01:02 AM, Stefan Karlsson wrote:
>> Hi Sangheon,
>>
>> On 2015-04-09 01:07, Sangheon Kim wrote:
>>> Hi all,
>>>
>>> I am sending this RFR again to open mailing alias.
>>>
>>> Please review this change to remove hang with 
>>> "-XX:ParallelGCThreads=0".
>>>
>>> Java hangs with "-XX:+UseG1GC -XX:ParallelGCThreads=0 
>>> -XX:+ExplicitGCInvokesConcurrent" combinations of options. If use 
>>> -XX:-ExplicitGCInvokesConcurrent or -XX:ParallelGCThreads=1 then all 
>>> works fine.
>>> To check this issue compile and run below application[1] using this 
>>> command "java -XX:+UseG1GC -XX:ParallelGCThreads=0 
>>> -XX:+ExplicitGCInvokesConcurrent TestApp"
>>>
>>> This is a regression resulted by recent backport from jdk9. But as 
>>> jdk9 disallows "ParallelGCThreads=0", this test is okay with jdk9.
>>> In addition, backport of disallowing "ParallGCThreads=0" is not an 
>>> option as it will change the behavior.
>>>
>>> The hang is happening at 
>>> "G1RootProcessor::wait_until_all_strong_classes_discovered()" since 
>>> we can't escape from while loop of "while 
>>> ((uint)_n_workers_discovered_strong_classes != n_workers)".
>>>
>>> This change makes to run a logic of 
>>> "G1RootProcessor::wait_until_all_strong_classes_discovered()" and 
>>> "G1RootProcessor::worker_has_discovered_all_strong_classes()", if gc 
>>> workers are larger than 0.
>>> And this change is same as the original code before change of backport.
>>>
>>> I will need a sponsor for this change.
>>>
>>> CR:
>>> https://bugs.openjdk.java.net/browse/JDK-8076325
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~sangheki/8076325/webrev.00/
>>
>> The patch looks good. Could you turn your test into a jtreg test?
> This test is already included in jtreg.

OK. It was removed from JDK 9 but is still present in JDK 8u.

> I copied this test from the JBS issue attachment to share people who 
> can't access the issue.

Here's the test:
http://hg.openjdk.java.net/jdk8u/hs-dev/hotspot/file/5b2cd065dfc6/test/gc/8000311/Test8000311.java

Thanks,
StefanK

>
> Thanks,
> Sangheon
>
>
>>
>> Thanks,
>> StefanK
>>
>>>
>>> Test:
>>> JPRT
>>>
>>> [1]: TestApp.java:
>>> import java.util.*;
>>>
>>> public class Test8000311 {
>>>   public static void main(String args[]) {
>>>     for(int i = 0; i<100; i++) {
>>>       byte[] garbage = new byte[1000];
>>>       System.gc();
>>>       System.out.println(i);
>>>     }
>>>     System.out.println("PASS");
>>>   }
>>> }
>>>
>>> Thanks,
>>> Sangheon
>>
>




More information about the hotspot-gc-dev mailing list