comparison src/share/vm/runtime/arguments.cpp @ 3767:2a241e764894

6941923: RFE: Handling large log files produced by long running Java Applications Summary: supply optinal flags to realize gc log rotation Reviewed-by: ysr, jwilhelm
author minqi
date Fri, 10 Jun 2011 15:08:36 -0700
parents 942e888897bc
children ef2d1b8f2dd4
comparison
equal deleted inserted replaced
3765:ae5b2f1dcf12 3767:2a241e764894
1678 return (UseSerialGC && 1678 return (UseSerialGC &&
1679 !(UseParNewGC || (UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC || 1679 !(UseParNewGC || (UseConcMarkSweepGC || CMSIncrementalMode) || UseG1GC ||
1680 UseParallelGC || UseParallelOldGC)); 1680 UseParallelGC || UseParallelOldGC));
1681 } 1681 }
1682 1682
1683 // check if do gclog rotation
1684 // +UseGCLogFileRotation is a must,
1685 // no gc log rotation when log file not supplied or
1686 // NumberOfGCLogFiles is 0, or GCLogFileSize is 0
1687 void check_gclog_consistency() {
1688 if (UseGCLogFileRotation) {
1689 if ((Arguments::gc_log_filename() == NULL) ||
1690 (NumberOfGCLogFiles == 0) ||
1691 (GCLogFileSize == 0)) {
1692 jio_fprintf(defaultStream::output_stream(),
1693 "To enable GC log rotation, use -Xloggc:<filename> -XX:+UseGCLogRotaion -XX:NumberOfGCLogFiles=<num_of_files> -XX:GCLogFileSize=<num_of_size>\n"
1694 "where num_of_file > 0 and num_of_size > 0\n"
1695 "GC log rotation is turned off\n");
1696 UseGCLogFileRotation = false;
1697 }
1698 }
1699
1700 if (UseGCLogFileRotation && GCLogFileSize < 8*K) {
1701 FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
1702 jio_fprintf(defaultStream::output_stream(),
1703 "GCLogFileSize changed to minimum 8K\n");
1704 }
1705 }
1706
1683 // Check consistency of GC selection 1707 // Check consistency of GC selection
1684 bool Arguments::check_gc_consistency() { 1708 bool Arguments::check_gc_consistency() {
1709 check_gclog_consistency();
1685 bool status = true; 1710 bool status = true;
1686 // Ensure that the user has not selected conflicting sets 1711 // Ensure that the user has not selected conflicting sets
1687 // of collectors. [Note: this check is merely a user convenience; 1712 // of collectors. [Note: this check is merely a user convenience;
1688 // collectors over-ride each other so that only a non-conflicting 1713 // collectors over-ride each other so that only a non-conflicting
1689 // set is selected; however what the user gets is not what they 1714 // set is selected; however what the user gets is not what they
2670 // Unknown option 2695 // Unknown option
2671 } else if (is_bad_option(option, args->ignoreUnrecognized)) { 2696 } else if (is_bad_option(option, args->ignoreUnrecognized)) {
2672 return JNI_ERR; 2697 return JNI_ERR;
2673 } 2698 }
2674 } 2699 }
2700
2675 // Change the default value for flags which have different default values 2701 // Change the default value for flags which have different default values
2676 // when working with older JDKs. 2702 // when working with older JDKs.
2677 if (JDK_Version::current().compare_major(6) <= 0 && 2703 if (JDK_Version::current().compare_major(6) <= 0 &&
2678 FLAG_IS_DEFAULT(UseVMInterruptibleIO)) { 2704 FLAG_IS_DEFAULT(UseVMInterruptibleIO)) {
2679 FLAG_SET_DEFAULT(UseVMInterruptibleIO, true); 2705 FLAG_SET_DEFAULT(UseVMInterruptibleIO, true);