This commit is contained in:
Karen Kinnear 2010-03-11 14:41:29 -05:00
commit 8d1747bc4b
28 changed files with 1802 additions and 158 deletions

View file

@ -1203,6 +1203,11 @@ void Arguments::set_cms_and_parnew_gc_flags() {
if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight);
}
if (PrintGCDetails && Verbose) {
tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
MarkStackSize / K, MarkStackSizeMax / K);
tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
}
}
#endif // KERNEL
@ -1339,6 +1344,17 @@ void Arguments::set_g1_gc_flags() {
if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) {
FLAG_SET_DEFAULT(MaxGCPauseMillis, 200);
}
if (FLAG_IS_DEFAULT(MarkStackSize)) {
// Size as a multiple of TaskQueueSuper::N which is larger
// for 64-bit.
FLAG_SET_DEFAULT(MarkStackSize, 128 * TaskQueueSuper::total_size());
}
if (PrintGCDetails && Verbose) {
tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
MarkStackSize / K, MarkStackSizeMax / K);
tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
}
}
void Arguments::set_heap_size() {
@ -1737,6 +1753,11 @@ bool Arguments::check_vm_args_consistency() {
status = false;
}
if (UseG1GC) {
status = status && verify_percentage(InitiatingHeapOccupancyPercent,
"InitiatingHeapOccupancyPercent");
}
status = status && verify_interval(RefDiscoveryPolicy,
ReferenceProcessor::DiscoveryPolicyMin,
ReferenceProcessor::DiscoveryPolicyMax,
@ -1795,6 +1816,29 @@ static bool match_option(const JavaVMOption* option, const char** names, const c
return false;
}
bool Arguments::parse_uintx(const char* value,
uintx* uintx_arg,
uintx min_size) {
// Check the sign first since atomull() parses only unsigned values.
bool value_is_positive = !(*value == '-');
if (value_is_positive) {
julong n;
bool good_return = atomull(value, &n);
if (good_return) {
bool above_minimum = n >= min_size;
bool value_is_too_large = n > max_uintx;
if (above_minimum && !value_is_too_large) {
*uintx_arg = n;
return true;
}
}
}
return false;
}
Arguments::ArgsRange Arguments::parse_memory_size(const char* s,
julong* long_arg,
julong min_size) {
@ -2453,6 +2497,37 @@ SOLARIS_ONLY(
jio_fprintf(defaultStream::error_stream(),
"Please use -XX:YoungPLABSize in place of "
"-XX:ParallelGCToSpaceAllocBufferSize in the future\n");
} else if (match_option(option, "-XX:CMSMarkStackSize=", &tail) ||
match_option(option, "-XX:G1MarkStackSize=", &tail)) {
julong stack_size = 0;
ArgsRange errcode = parse_memory_size(tail, &stack_size, 1);
if (errcode != arg_in_range) {
jio_fprintf(defaultStream::error_stream(),
"Invalid mark stack size: %s\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size);
} else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
julong max_stack_size = 0;
ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
if (errcode != arg_in_range) {
jio_fprintf(defaultStream::error_stream(),
"Invalid maximum mark stack size: %s\n",
option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size);
} else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
uintx conc_threads = 0;
if (!parse_uintx(tail, &conc_threads, 1)) {
jio_fprintf(defaultStream::error_stream(),
"Invalid concurrent threads: %s\n", option->optionString);
return JNI_EINVAL;
}
FLAG_SET_CMDLINE(uintx, ConcGCThreads, conc_threads);
} else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
// Skip -XX:Flags= since that case has already been handled
if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {

View file

@ -343,6 +343,12 @@ class Arguments : AllStatic {
static ArgsRange check_memory_size(julong size, julong min_size);
static ArgsRange parse_memory_size(const char* s, julong* long_arg,
julong min_size);
// Parse a string for a unsigned integer. Returns true if value
// is an unsigned integer greater than or equal to the minimum
// parameter passed and returns the value in uintx_arg. Returns
// false otherwise, with uintx_arg undefined.
static bool parse_uintx(const char* value, uintx* uintx_arg,
uintx min_size);
// methods to build strings from individual args
static void build_jvm_args(const char* arg);

View file

@ -1245,9 +1245,6 @@ class CommandLineFlags {
product(uintx, ParallelGCThreads, 0, \
"Number of parallel threads parallel gc will use") \
\
product(uintx, ParallelCMSThreads, 0, \
"Max number of threads CMS will use for concurrent work") \
\
develop(bool, ParallelOldGCSplitALot, false, \
"Provoke splitting (copying data from a young gen space to" \
"multiple destination spaces)") \
@ -1258,8 +1255,8 @@ class CommandLineFlags {
develop(bool, TraceRegionTasksQueuing, false, \
"Trace the queuing of the region tasks") \
\
product(uintx, ParallelMarkingThreads, 0, \
"Number of marking threads concurrent gc will use") \
product(uintx, ConcGCThreads, 0, \
"Number of threads concurrent gc will use") \
\
product(uintx, YoungPLABSize, 4096, \
"Size of young gen promotion labs (in HeapWords)") \
@ -1535,11 +1532,11 @@ class CommandLineFlags {
develop(bool, CMSOverflowEarlyRestoration, false, \
"Whether preserved marks should be restored early") \
\
product(uintx, CMSMarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M), \
"Size of CMS marking stack") \
product(uintx, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M), \
"Size of marking stack") \
\
product(uintx, CMSMarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M), \
"Max size of CMS marking stack") \
product(uintx, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M), \
"Max size of marking stack") \
\
notproduct(bool, CMSMarkStackOverflowALot, false, \
"Whether we should simulate frequent marking stack / work queue" \
@ -1724,6 +1721,13 @@ class CommandLineFlags {
"Percentage CMS generation occupancy to start a CMS collection " \
"cycle. A negative value means that CMSTriggerRatio is used") \
\
product(uintx, InitiatingHeapOccupancyPercent, 45, \
"Percentage of the (entire) heap occupancy to start a " \
"concurrent GC cycle. It us used by GCs that trigger a " \
"concurrent GC cycle based on the occupancy of the entire heap, " \
"not just one of the generations (e.g., G1). A value of 0 " \
"denotes 'do constant GC cycles'.") \
\
product(intx, CMSInitiatingPermOccupancyFraction, -1, \
"Percentage CMS perm generation occupancy to start a " \
"CMScollection cycle. A negative value means that " \