Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-67940

Rotated GC logs are not collected with JDK 11

XMLWordPrintable

    • support-core:1130.vb_eef6015fc37

      Noticed recently that the rotated GC logs are not collected with JDK 11 when using the filecount / filesize options, only for %t / %p options. For example:

      -Xlog:gc\*=info,heap=debug,ref\*=debug,ergo\*=trace,age\*=trace:file=$JENKINS_HOME/.jvm/gc.log:time,level,tags:filecount=5,filesize=40M
      

      As per https://docs.oracle.com/javase/9/tools/java.htm#GUID-BE93ABDC-999C-4CB5-A88B-1994AAAC74D5__OUTPUTS-A7A49D8E

      When using file=filename, specifying %p and/or %t in the file name expands to the JVM's PID and startup timestamp, respectively. You can also configure text files to handle file rotation based on file size and a number of files to rotate. For example, to rotate the log file every 10 MB and keep 5 files in rotation, specify the options filesize=10M, filecount=5. The target size of the files isn’t guaranteed to be exact, it’s just an approximate value. Files are rotated by default with up to 5 rotated files of target size 20 MB, unless configured otherwise. Specifying filecount=0 means that the log file shouldn’t be rotated. There’s a possibility of the pre-existing log file getting overwritten.
      

      So with JDK 11, logs are rotated if there is no filecount=0 OR if %[pt] are in use.

            allan_burdajewicz Allan BURDAJEWICZ
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: