hotspot/src/share/vm/runtime/arguments.cpp
changeset 23517 27c4307d6cda
parent 23474 55fbc11353ec
child 23519 9a78876cefeb
equal deleted inserted replaced
23516:b32d8f04648b 23517:27c4307d6cda
  1905 #endif // INCLUDE_ALL_GCS
  1905 #endif // INCLUDE_ALL_GCS
  1906 
  1906 
  1907 // check if do gclog rotation
  1907 // check if do gclog rotation
  1908 // +UseGCLogFileRotation is a must,
  1908 // +UseGCLogFileRotation is a must,
  1909 // no gc log rotation when log file not supplied or
  1909 // no gc log rotation when log file not supplied or
  1910 // NumberOfGCLogFiles is 0, or GCLogFileSize is 0
  1910 // NumberOfGCLogFiles is 0
  1911 void check_gclog_consistency() {
  1911 void check_gclog_consistency() {
  1912   if (UseGCLogFileRotation) {
  1912   if (UseGCLogFileRotation) {
  1913     if ((Arguments::gc_log_filename() == NULL) ||
  1913     if ((Arguments::gc_log_filename() == NULL) || (NumberOfGCLogFiles == 0)) {
  1914         (NumberOfGCLogFiles == 0)  ||
       
  1915         (GCLogFileSize == 0)) {
       
  1916       jio_fprintf(defaultStream::output_stream(),
  1914       jio_fprintf(defaultStream::output_stream(),
  1917                   "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>[k|K|m|M|g|G]\n"
  1915                   "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files>\n"
  1918                   "where num_of_file > 0 and num_of_size > 0\n"
  1916                   "where num_of_file > 0\n"
  1919                   "GC log rotation is turned off\n");
  1917                   "GC log rotation is turned off\n");
  1920       UseGCLogFileRotation = false;
  1918       UseGCLogFileRotation = false;
  1921     }
  1919     }
  1922   }
  1920   }
  1923 
  1921 
  1924   if (UseGCLogFileRotation && GCLogFileSize < 8*K) {
  1922   if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
  1925         FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
  1923     FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
  1926         jio_fprintf(defaultStream::output_stream(),
  1924     jio_fprintf(defaultStream::output_stream(),
  1927                     "GCLogFileSize changed to minimum 8K\n");
  1925                 "GCLogFileSize changed to minimum 8K\n");
  1928   }
  1926   }
  1929 }
  1927 }
  1930 
  1928 
  1931 // This function is called for -Xloggc:<filename>, it can be used
  1929 // This function is called for -Xloggc:<filename>, it can be used
  1932 // to check if a given file name(or string) conforms to the following
  1930 // to check if a given file name(or string) conforms to the following