[ 
https://issues.apache.org/jira/browse/SOLR-12874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16650964#comment-16650964
 ] 

Tim Underwood commented on SOLR-12874:
--------------------------------------

[~elyograg] The options are already broken out by java version.  20M is 
currently used for Java 8.  Here is the current code:
   
{noformat}
# if verbose gc logging enabled, setup the location of the log file and rotation
if [ "$GC_LOG_OPTS" != "" ]; then
  if [[ "$JAVA_VER_NUM" -lt "9" ]] ; then
    gc_log_flag="-Xloggc"
    if [ "$JAVA_VENDOR" == "IBM J9" ]; then
      gc_log_flag="-Xverbosegclog"
    fi
    GC_LOG_OPTS+=("$gc_log_flag:$SOLR_LOGS_DIR/solr_gc.log" 
'-XX:+UseGCLogFileRotation' '-XX:NumberOfGCLogFiles=9' '-XX:GCLogFileSize=20M')
  else
    # http://openjdk.java.net/jeps/158
    for i in "${!GC_LOG_OPTS[@]}";
    do
      # for simplicity, we only look at the prefix '-Xlog:gc'
      # (if 'all' or multiple tags are used starting with anything other then 
'gc' the user is on their own)
      # if a single additional ':' exists in param, then there is already an 
explicit output specifier
      GC_LOG_OPTS[$i]=$(echo ${GC_LOG_OPTS[$i]} | sed 
"s|^\(-Xlog:gc[^:]*$\)|\1:file=$SOLR_LOGS_DIR/solr_gc.log:time,uptime:filecount=9,filesize=20000|")
    done
  fi
fi
{noformat}
Java 8 (and anything less than 9) is using:
{noformat}
-XX:GCLogFileSize=20M
{noformat}

> Java 9+ GC Log files are being rotated every 20KB instead of every 20MB
> -----------------------------------------------------------------------
>
>                 Key: SOLR-12874
>                 URL: https://issues.apache.org/jira/browse/SOLR-12874
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 7.5
>            Reporter: Tim Underwood
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The Java 9+ GC logging options in bin/solr and bin/solr.cmd specify a log 
> rotation file size of 20000 which according to JEP 158 
> ([https://openjdk.java.net/jeps/158]) should be the "file size in kb" however 
> when running Solr on Java 11 I'm seeing GC logs rotated every 20KB.
> Changing "filesize=20000" to "filesize=20M" fixes the problem for me under 
> Linux.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to