src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7164841 Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page
7164841: Improvements to the GC log file rotation


1833 #if !INCLUDE_ALL_GCS
1834 #ifdef ASSERT
1835 static bool verify_serial_gc_flags() {
1836   return (UseSerialGC &&
1837         !(UseParNewGC || (UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC ||
1838           UseParallelGC || UseParallelOldGC));
1839 }
1840 #endif // ASSERT
1841 #endif // INCLUDE_ALL_GCS
1842 
1843 // check if do gclog rotation
1844 // +UseGCLogFileRotation is a must,
1845 // no gc log rotation when log file not supplied or
1846 // NumberOfGCLogFiles is 0, or GCLogFileSize is 0
1847 void check_gclog_consistency() {
1848   if (UseGCLogFileRotation) {
1849     if ((Arguments::gc_log_filename() == NULL) ||
1850         (NumberOfGCLogFiles == 0)  ||
1851         (GCLogFileSize == 0)) {
1852       jio_fprintf(defaultStream::output_stream(),
1853                   "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>\n"
1854                   "where num_of_file > 0 and num_of_size > 0\n"
1855                   "GC log rotation is turned off\n");
1856       UseGCLogFileRotation = false;
1857     }
1858   }
1859 
1860   if (UseGCLogFileRotation && GCLogFileSize < 8*K) {
1861         FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
1862         jio_fprintf(defaultStream::output_stream(),
1863                     "GCLogFileSize changed to minimum 8K\n");
1864   }
1865 }
1866 
1867 // Check consistency of GC selection
1868 bool Arguments::check_gc_consistency() {
1869   check_gclog_consistency();
1870   bool status = true;
1871   // Ensure that the user has not selected conflicting sets
1872   // of collectors. [Note: this check is merely a user convenience;
1873   // collectors over-ride each other so that only a non-conflicting




1833 #if !INCLUDE_ALL_GCS
1834 #ifdef ASSERT
1835 static bool verify_serial_gc_flags() {
1836   return (UseSerialGC &&
1837         !(UseParNewGC || (UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC ||
1838           UseParallelGC || UseParallelOldGC));
1839 }
1840 #endif // ASSERT
1841 #endif // INCLUDE_ALL_GCS
1842 
1843 // check if do gclog rotation
1844 // +UseGCLogFileRotation is a must,
1845 // no gc log rotation when log file not supplied or
1846 // NumberOfGCLogFiles is 0, or GCLogFileSize is 0
1847 void check_gclog_consistency() {
1848   if (UseGCLogFileRotation) {
1849     if ((Arguments::gc_log_filename() == NULL) ||
1850         (NumberOfGCLogFiles == 0)  ||
1851         (GCLogFileSize == 0)) {
1852       jio_fprintf(defaultStream::output_stream(),
1853                   "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>[k|K|m|M]\n"
1854                   "where num_of_file > 0 and num_of_size > 0\n"
1855                   "GC log rotation is turned off\n");
1856       UseGCLogFileRotation = false;
1857     }
1858   }
1859 
1860   if (UseGCLogFileRotation && GCLogFileSize < 8*K) {
1861         FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
1862         jio_fprintf(defaultStream::output_stream(),
1863                     "GCLogFileSize changed to minimum 8K\n");
1864   }
1865 }
1866 
1867 // Check consistency of GC selection
1868 bool Arguments::check_gc_consistency() {
1869   check_gclog_consistency();
1870   bool status = true;
1871   // Ensure that the user has not selected conflicting sets
1872   // of collectors. [Note: this check is merely a user convenience;
1873   // collectors over-ride each other so that only a non-conflicting


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File