<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    Hi again everyone,<br>
    <br>
    It seems like the feedback on hotspot-gc-use is that we should add
    the GC cause to all collectors but also provide a switch to turn
    this logging off.<br>
    <br>
    Here is an updated webrev:<br>
    <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~brutisso/7166894/webrev.03/">http://cr.openjdk.java.net/~brutisso/7166894/webrev.03/</a><br>
    <br>
    Changes:<br>
    * GC cause logged for all collectors<br>
    * Added the flag -XX:-PrintGCCause to turn the new information off<br>
    * Refactored the string concatenation code into a helper class<br>
    <br>
    I guess I will also have to update the CR to now reflect the fact
    that this does not just concern full GCs anymore.<br>
    <br>
    Thanks,<br>
    Bengt<br>
    <br>
    On 2012-05-07 23:10, Bengt Rutisson wrote:
    <blockquote cite="mid:4FA83A28.1040504@oracle.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <br>
      Hi Kris,<br>
      <br>
      Thanks for looking at this!<br>
      <br>
      Good point regarding CMS. I guess I am a bit concerned about
      changing that since it might start breaking more parsers. I'll
      send a question out on the hotspot-gc-use mailing list to get some
      feedback.<br>
      <br>
      If we do go for adding this information to CMS we can probably
      also take the chance of adding it to all the young GCs.<br>
      <br>
      I looked at the log sample you referred to. It looks like you were
      logging more details about exactly why a GC was triggered. That is
      probably a good idea, but for now I think we should settle for
      just the text message describing the cause.<br>
      <br>
      Thanks again for looking at this,<br>
      Bengt<br>
      <br>
      On 2012-05-07 15:19, Krystal Mok wrote:
      <blockquote
cite="mid:CA+cQ+tSFTG9P62aCSBQWucom3Cg6SYDgJQ1HJO=4yJsX6ZJwqA@mail.gmail.com"
        type="cite">Hi Bengt,
        <div><br>
        </div>
        <div>FYI, I did something similar to CMS as well, covered by a
          new flag called "PrintGCReason" in my build.</div>
        <div>It's primitive, compared with your change. I was striving
          to keep the log within the brackets just as they were, and
          instead print extra information before the opening bracket, on
          a separate line. The parsing tool we use tend to ignore the
          lines it couldn't recognize, so doing it this way interrupted
          the tool the least.</div>
        <div><br>
        </div>
        <div>An example of the output can be found here [1], page
          42. The motivation to add the extra logging was to track down
          a mysterious behavior in CMS that it keep doing back-to-back
          collections, without much gains, as explained in [1]. I needed
          to know why it was triggered. Some of our applications
          actually liked the extra logging, so it remained in the code
          base after the bug was found.</div>
        <div><br>
        </div>
        <div>Anyway, I like the idea of getting more info out of GC
          logs, in a uniform way.</div>
        <div>Would you mind adding the extra logging to CMS, too?</div>
        <div><br>
        </div>
        <div>- Kris</div>
        <div><br>
        </div>
        <div>[1]: <a moz-do-not-send="true"
            href="http://www.slideshare.net/RednaxelaFX/jvm-taobao">http://www.slideshare.net/RednaxelaFX/jvm-taobao</a><br>
          <br>
          <div class="gmail_quote">On Mon, May 7, 2012 at 8:31 PM, Bengt
            Rutisson <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:bengt.rutisson@oracle.com" target="_blank">bengt.rutisson@oracle.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
              Hi all,<br>
              <br>
              Can I get a couple of reviews of this simple change:<br>
              <a moz-do-not-send="true"
                href="http://cr.openjdk.java.net/%7Ebrutisso/7166894/webrev/"
                target="_blank">http://cr.openjdk.java.net/~brutisso/7166894/webrev/</a><br>
              <br>
              Background:<br>
              I recently pushed a similar fix for G1 as "7163848: G1:
              Log GC Cause for a GC". That fix adds the GC cause
              information to all G1 GCs. It was discussed if we should
              do this for all collectors and we came to the conclusion
              that it would be fairly safe to do it for all Full GCs.
              These log messages already contain the text "(System)" or
              "(System.gc())" when a System.gc() happens and
              PrintGCDetails are enabled. Now they will always contain
              the cause in parenthesis, even when only PrintGC is
              enabled. Hopefully most parsing will work with this.<br>
              <br>
              Thanks,<br>
              Bengt<br>
            </blockquote>
          </div>
          <br>
        </div>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>