<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Junjie,<br>
    <br>
    If you want a definitive answer, you really have to go<br>
    look at the code.   If you're willing to take my best<br>
    recollection then read on.<br>
    <br>
    <div class="moz-cite-prefix">On 02/23/2015 02:28 PM, Junjie Qian
      wrote:<br>
    </div>
    <blockquote
cite="mid:2045381094.8663658.1424730520340.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:12px">
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><span id="yui_3_16_0_1_1424730474721_2187"
            class="" style="">Dear all,</span></div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><br class="" style="">
        </div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><span
            id="yiv2267844137yui_3_16_0_1_1423968298086_6747" class=""
            style="">I am reading the Parallel scavenge GC
            implementation in OpenJDK1.7, and having a question
            regarding the way how the parallel GC threads traverse the
            heap graph to mark the live objects.</span></div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><br class="" style="">
        </div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><span
            id="yiv2267844137yui_3_16_0_1_1423968298086_6677" class=""
            style="">The question is, does one GC thread traverse the
            graph in DFS or BFS way in Parallel scavenge (or parallel
            new)?</span></div>
      </div>
    </blockquote>
    UseParallelGC had both DFS and BFS under a flag.  I think the BFS
    was removed in 7.<br>
    <br>
    <blockquote
cite="mid:2045381094.8663658.1424730520340.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:12px">
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><br class="" style="">
        </div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style="">There are two conflicting sources suggesting
          the answer:</div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style="">1. the paper on ASPLOS'13, "A study of the
          scalability of stop-the-world garbage collectors on
          multicores", in Section 2.3.3. the author says "A GC thread
          performs a breadth-first traversal (BFT) of the graph of live
          objects".</div>
      </div>
    </blockquote>
    <blockquote
cite="mid:2045381094.8663658.1424730520340.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:12px">
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><br class="" style="">
        </div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style="">2. the reply in this mailist, "Request for
          review (S): 8005972: ParNew should not update the tenuring
          threshold when promotion failed has occurred" , Ramki said
          "ParNew's slightly more DFS-like evacuation compared with
          DefNew's considerably more BFS-like evacuation because of the
          latter's use of a pure Cheney scan compared with the use of
          (a) marking stack(s) in the former"</div>
      </div>
    </blockquote>
    <br>
    Trust Ramki's description at that time, but I would have called
    UseParNewGC predominantly BFS.<br>
    <blockquote
cite="mid:2045381094.8663658.1424730520340.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:12px">
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style=""><br class="" style="">
        </div>
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6574" dir="ltr"
          class="" style="">A lot of references online explains Parnew
          uses the same parallel GC algorithm as ParallelScavenge,
          please correct me if I made a mistake on this one.</div>
      </div>
    </blockquote>
    <br>
    UseParallelGC and UseParNewGC are both copying collectors that use
    multiple threads so<br>
    in that since they use the same algorithm.    They share very little
    code.  UseParNewGC<br>
    works with CMS and makes some accommodations for CMS.   Kinda of
    like a Ford<br>
    and a Chevy are both cars.<br>
    <br>
    Jon<br>
    <br>
    <blockquote
cite="mid:2045381094.8663658.1424730520340.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, sans-serif;font-size:12px">
        <div id="yiv2267844137yui_3_16_0_1_1423968298086_6573" class=""
          style=""> </div>
        <div class="" id="yiv2267844137yui_3_16_0_1_1423968298086_6500"
          style="">
          <div id="yiv2267844137yui_3_16_0_1_1423968298086_6572"
            class="" style="">Thanks!</div>
          <div id="yiv2267844137yui_3_16_0_1_1423968298086_6571"
            class="" style="">Best</div>
          <div id="yiv2267844137yui_3_16_0_1_1423968298086_6499"
            class="" style="">Junjie</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
hotspot-gc-use mailing list
<a class="moz-txt-link-abbreviated" href="mailto:hotspot-gc-use@openjdk.java.net">hotspot-gc-use@openjdk.java.net</a>
<a class="moz-txt-link-freetext" href="http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use">http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>