comparison src/share/vm/runtime/arguments.cpp @ 7451:ca0a78017dc7

8005396: Use ParNew with only one thread instead of DefNew as default for CMS on single CPU machines Reviewed-by: jmasa, jcoomes
author brutisso
date Sun, 30 Dec 2012 08:47:52 +0100
parents 442f942757c0
children e0ab18eafbde
comparison
equal deleted inserted replaced
7450:d275c3dc73e6 7451:ca0a78017dc7
1081 } 1081 }
1082 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false); 1082 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
1083 } 1083 }
1084 } 1084 }
1085 1085
1086 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC
1087 // if it's not explictly set or unset. If the user has chosen
1088 // UseParNewGC and not explicitly set ParallelGCThreads we
1089 // set it, unless this is a single cpu machine.
1090 void Arguments::set_parnew_gc_flags() { 1086 void Arguments::set_parnew_gc_flags() {
1091 assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC, 1087 assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC,
1092 "control point invariant"); 1088 "control point invariant");
1093 assert(UseParNewGC, "Error"); 1089 assert(UseParNewGC, "Error");
1094 1090
1095 // Turn off AdaptiveSizePolicy for parnew until it is complete. 1091 // Turn off AdaptiveSizePolicy for parnew until it is complete.
1096 disable_adaptive_size_policy("UseParNewGC"); 1092 disable_adaptive_size_policy("UseParNewGC");
1097 1093
1098 if (ParallelGCThreads == 0) { 1094 if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
1099 FLAG_SET_DEFAULT(ParallelGCThreads, 1095 FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
1100 Abstract_VM_Version::parallel_worker_threads()); 1096 assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
1101 if (ParallelGCThreads == 1) { 1097 } else if (ParallelGCThreads == 0) {
1102 FLAG_SET_DEFAULT(UseParNewGC, false); 1098 jio_fprintf(defaultStream::error_stream(),
1103 FLAG_SET_DEFAULT(ParallelGCThreads, 0); 1099 "The ParNew GC can not be combined with -XX:ParallelGCThreads=0\n");
1104 } 1100 vm_exit(1);
1105 } 1101 }
1106 if (UseParNewGC) { 1102
1107 // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively, 1103 // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
1108 // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration 1104 // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
1109 // we set them to 1024 and 1024. 1105 // we set them to 1024 and 1024.
1110 // See CR 6362902. 1106 // See CR 6362902.
1111 if (FLAG_IS_DEFAULT(YoungPLABSize)) { 1107 if (FLAG_IS_DEFAULT(YoungPLABSize)) {
1112 FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024); 1108 FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024);
1113 } 1109 }
1114 if (FLAG_IS_DEFAULT(OldPLABSize)) { 1110 if (FLAG_IS_DEFAULT(OldPLABSize)) {
1115 FLAG_SET_DEFAULT(OldPLABSize, (intx)1024); 1111 FLAG_SET_DEFAULT(OldPLABSize, (intx)1024);
1116 } 1112 }
1117 1113
1118 // AlwaysTenure flag should make ParNew promote all at first collection. 1114 // AlwaysTenure flag should make ParNew promote all at first collection.
1119 // See CR 6362902. 1115 // See CR 6362902.
1120 if (AlwaysTenure) { 1116 if (AlwaysTenure) {
1121 FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0); 1117 FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0);
1122 } 1118 }
1123 // When using compressed oops, we use local overflow stacks, 1119 // When using compressed oops, we use local overflow stacks,
1124 // rather than using a global overflow list chained through 1120 // rather than using a global overflow list chained through
1125 // the klass word of the object's pre-image. 1121 // the klass word of the object's pre-image.
1126 if (UseCompressedOops && !ParGCUseLocalOverflow) { 1122 if (UseCompressedOops && !ParGCUseLocalOverflow) {
1127 if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) { 1123 if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) {
1128 warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references"); 1124 warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references");
1129 } 1125 }
1130 FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true); 1126 FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true);
1131 } 1127 }
1132 assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error"); 1128 assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error");
1133 }
1134 } 1129 }
1135 1130
1136 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on 1131 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on
1137 // sparc/solaris for certain applications, but would gain from 1132 // sparc/solaris for certain applications, but would gain from
1138 // further optimization and tuning efforts, and would almost 1133 // further optimization and tuning efforts, and would almost