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


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




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