comparison src/share/vm/runtime/arguments.cpp @ 7397:442f942757c0

8000244: G1: Ergonomically set MarkStackSize and use virtual space for global marking stack Summary: Set the value of MarkStackSize to a value based on the number of parallel marking threads with a reasonable minimum. Expand the marking stack if we have to restart marking due to an overflow up to a reasonable maximum. Allocate the underlying space for the marking stack from virtual memory. Reviewed-by: jmasa, brutisso
author johnc
date Mon, 01 Oct 2012 09:28:13 -0700
parents 53715fb1597d
children ca0a78017dc7 4daebd4cc1dd d092d1b31229
comparison
equal deleted inserted replaced
7208:eade6b2e4782 7397:442f942757c0
1497 if (ParallelGCThreads == 0) { 1497 if (ParallelGCThreads == 0) {
1498 FLAG_SET_DEFAULT(ParallelGCThreads, 1498 FLAG_SET_DEFAULT(ParallelGCThreads,
1499 Abstract_VM_Version::parallel_worker_threads()); 1499 Abstract_VM_Version::parallel_worker_threads());
1500 } 1500 }
1501 1501
1502 if (FLAG_IS_DEFAULT(MarkStackSize)) { 1502 // MarkStackSize will be set (if it hasn't been set by the user)
1503 FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE); 1503 // when concurrent marking is initialized.
1504 } 1504 // Its value will be based upon the number of parallel marking threads.
1505 if (PrintGCDetails && Verbose) { 1505 // But we do set the maximum mark stack size here.
1506 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", 1506 if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
1507 MarkStackSize / K, MarkStackSizeMax / K); 1507 FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
1508 tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
1509 } 1508 }
1510 1509
1511 if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) { 1510 if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
1512 // In G1, we want the default GC overhead goal to be higher than 1511 // In G1, we want the default GC overhead goal to be higher than
1513 // say in PS. So we set it here to 10%. Otherwise the heap might 1512 // say in PS. So we set it here to 10%. Otherwise the heap might
1514 // be expanded more aggressively than we would like it to. In 1513 // be expanded more aggressively than we would like it to. In
1515 // fact, even 10% seems to not be high enough in some cases 1514 // fact, even 10% seems to not be high enough in some cases
1516 // (especially small GC stress tests that the main thing they do 1515 // (especially small GC stress tests that the main thing they do
1517 // is allocation). We might consider increase it further. 1516 // is allocation). We might consider increase it further.
1518 FLAG_SET_DEFAULT(GCTimeRatio, 9); 1517 FLAG_SET_DEFAULT(GCTimeRatio, 9);
1518 }
1519
1520 if (PrintGCDetails && Verbose) {
1521 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
1522 MarkStackSize / K, MarkStackSizeMax / K);
1523 tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
1519 } 1524 }
1520 } 1525 }
1521 1526
1522 void Arguments::set_heap_size() { 1527 void Arguments::set_heap_size() {
1523 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { 1528 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
1977 1982
1978 status = status && verify_object_alignment(); 1983 status = status && verify_object_alignment();
1979 1984
1980 status = status && verify_min_value(ClassMetaspaceSize, 1*M, 1985 status = status && verify_min_value(ClassMetaspaceSize, 1*M,
1981 "ClassMetaspaceSize"); 1986 "ClassMetaspaceSize");
1987
1988 status = status && verify_interval(MarkStackSizeMax,
1989 1, (max_jint - 1), "MarkStackSizeMax");
1982 1990
1983 #ifdef SPARC 1991 #ifdef SPARC
1984 if (UseConcMarkSweepGC || UseG1GC) { 1992 if (UseConcMarkSweepGC || UseG1GC) {
1985 // Issue a stern warning if the user has explicitly set 1993 // Issue a stern warning if the user has explicitly set
1986 // UseMemSetInBOT (it is known to cause issues), but allow 1994 // UseMemSetInBOT (it is known to cause issues), but allow