1.1 --- a/src/share/vm/runtime/arguments.cpp Tue Feb 23 23:14:34 2010 -0500 1.2 +++ b/src/share/vm/runtime/arguments.cpp Wed Feb 24 07:00:33 2010 -0800 1.3 @@ -1203,6 +1203,11 @@ 1.4 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) { 1.5 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); 1.6 } 1.7 + if (PrintGCDetails && Verbose) { 1.8 + tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1.9 + MarkStackSize / K, MarkStackSizeMax / K); 1.10 + tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1.11 + } 1.12 } 1.13 #endif // KERNEL 1.14 1.15 @@ -1339,6 +1344,17 @@ 1.16 if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) { 1.17 FLAG_SET_DEFAULT(MaxGCPauseMillis, 200); 1.18 } 1.19 + 1.20 + if (FLAG_IS_DEFAULT(MarkStackSize)) { 1.21 + // Size as a multiple of TaskQueueSuper::N which is larger 1.22 + // for 64-bit. 1.23 + FLAG_SET_DEFAULT(MarkStackSize, 128 * TaskQueueSuper::total_size()); 1.24 + } 1.25 + if (PrintGCDetails && Verbose) { 1.26 + tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1.27 + MarkStackSize / K, MarkStackSizeMax / K); 1.28 + tty->print_cr("ConcGCThreads: %u", ConcGCThreads); 1.29 + } 1.30 } 1.31 1.32 void Arguments::set_heap_size() { 1.33 @@ -1800,6 +1816,29 @@ 1.34 return false; 1.35 } 1.36 1.37 +bool Arguments::parse_uintx(const char* value, 1.38 + uintx* uintx_arg, 1.39 + uintx min_size) { 1.40 + 1.41 + // Check the sign first since atomull() parses only unsigned values. 1.42 + bool value_is_positive = !(*value == '-'); 1.43 + 1.44 + if (value_is_positive) { 1.45 + julong n; 1.46 + bool good_return = atomull(value, &n); 1.47 + if (good_return) { 1.48 + bool above_minimum = n >= min_size; 1.49 + bool value_is_too_large = n > max_uintx; 1.50 + 1.51 + if (above_minimum && !value_is_too_large) { 1.52 + *uintx_arg = n; 1.53 + return true; 1.54 + } 1.55 + } 1.56 + } 1.57 + return false; 1.58 +} 1.59 + 1.60 Arguments::ArgsRange Arguments::parse_memory_size(const char* s, 1.61 julong* long_arg, 1.62 julong min_size) { 1.63 @@ -2458,6 +2497,37 @@ 1.64 jio_fprintf(defaultStream::error_stream(), 1.65 "Please use -XX:YoungPLABSize in place of " 1.66 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n"); 1.67 + } else if (match_option(option, "-XX:CMSMarkStackSize=", &tail) || 1.68 + match_option(option, "-XX:G1MarkStackSize=", &tail)) { 1.69 + julong stack_size = 0; 1.70 + ArgsRange errcode = parse_memory_size(tail, &stack_size, 1); 1.71 + if (errcode != arg_in_range) { 1.72 + jio_fprintf(defaultStream::error_stream(), 1.73 + "Invalid mark stack size: %s\n", option->optionString); 1.74 + describe_range_error(errcode); 1.75 + return JNI_EINVAL; 1.76 + } 1.77 + FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size); 1.78 + } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) { 1.79 + julong max_stack_size = 0; 1.80 + ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1); 1.81 + if (errcode != arg_in_range) { 1.82 + jio_fprintf(defaultStream::error_stream(), 1.83 + "Invalid maximum mark stack size: %s\n", 1.84 + option->optionString); 1.85 + describe_range_error(errcode); 1.86 + return JNI_EINVAL; 1.87 + } 1.88 + FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size); 1.89 + } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) || 1.90 + match_option(option, "-XX:ParallelCMSThreads=", &tail)) { 1.91 + uintx conc_threads = 0; 1.92 + if (!parse_uintx(tail, &conc_threads, 1)) { 1.93 + jio_fprintf(defaultStream::error_stream(), 1.94 + "Invalid concurrent threads: %s\n", option->optionString); 1.95 + return JNI_EINVAL; 1.96 + } 1.97 + FLAG_SET_CMDLINE(uintx, ConcGCThreads, conc_threads); 1.98 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx 1.99 // Skip -XX:Flags= since that case has already been handled 1.100 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {