src/share/vm/runtime/arguments.cpp

Print this page
rev 3905 : 8001424: G1: Rename certain G1-specific flags
Summary: Rename G1DefaultMinNewGenPercent, G1DefaultMaxNewGenPercent, and G1OldCSetRegionLiveThresholdPercent to G1NewSizePercent, G1MaxNewSizePercent, and G1MixedGCLiveThresholdPercent respectively. Continue, however, to accept the previous names. If both are specified, the new name takes precedence.
Reviewed-by:


1500   }
1501 
1502   // MarkStackSize will be set (if it hasn't been set by the user)
1503   // when concurrent marking is initialized.
1504   // Its value will be based upon the number of parallel marking threads.
1505   // But we do set the maximum mark stack size here.
1506   if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
1507     FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
1508   }
1509 
1510   if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
1511     // In G1, we want the default GC overhead goal to be higher than
1512     // say in PS. So we set it here to 10%. Otherwise the heap might
1513     // be expanded more aggressively than we would like it to. In
1514     // fact, even 10% seems to not be high enough in some cases
1515     // (especially small GC stress tests that the main thing they do
1516     // is allocation). We might consider increase it further.
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);
1524   }
1525 }
1526 
1527 void Arguments::set_heap_size() {
1528   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
1529     // Deprecated flag
1530     FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
1531   }
1532 
1533   const julong phys_mem =
1534     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
1535                             : (julong)MaxRAM;
1536 
1537   // If the maximum heap size has not been set with -Xmx,
1538   // then set it as fraction of the size of physical memory,
1539   // respecting the maximum and minimum sizes of the heap.




1500   }
1501 
1502   // MarkStackSize will be set (if it hasn't been set by the user)
1503   // when concurrent marking is initialized.
1504   // Its value will be based upon the number of parallel marking threads.
1505   // But we do set the maximum mark stack size here.
1506   if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
1507     FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
1508   }
1509 
1510   if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
1511     // In G1, we want the default GC overhead goal to be higher than
1512     // say in PS. So we set it here to 10%. Otherwise the heap might
1513     // be expanded more aggressively than we would like it to. In
1514     // fact, even 10% seems to not be high enough in some cases
1515     // (especially small GC stress tests that the main thing they do
1516     // is allocation). We might consider increase it further.
1517     FLAG_SET_DEFAULT(GCTimeRatio, 9);
1518   }
1519 
1520 #ifndef SERIALGC
1521   // The following flag names have been replaced. Accept the previous
1522   // name for a short while, but set the new flag to the value set
1523   // by the user. New flag names take precedence though.
1524   if (FLAG_IS_DEFAULT(G1NewSizePercent) && G1DefaultMinNewGenPercent > 0) {
1525     FLAG_SET_CMDLINE(uintx, G1NewSizePercent, G1DefaultMinNewGenPercent);
1526   }
1527   if (FLAG_IS_DEFAULT(G1MaxNewSizePercent) && G1DefaultMaxNewGenPercent > 0) {
1528     FLAG_SET_CMDLINE(uintx, G1MaxNewSizePercent, G1DefaultMaxNewGenPercent);
1529   }
1530   if (FLAG_IS_DEFAULT(G1MixedGCLiveThresholdPercent) &&
1531       G1OldCSetRegionLiveThresholdPercent > 0) {
1532     FLAG_SET_CMDLINE(uintx, G1MaxNewSizePercent, G1OldCSetRegionLiveThresholdPercent);
1533   }
1534 #endif
1535 
1536   if (PrintGCDetails && Verbose) {
1537     tty->print_cr("MarkStackSize: %uk  MarkStackSizeMax: %uk",
1538       MarkStackSize / K, MarkStackSizeMax / K);
1539     tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
1540   }
1541 }
1542 
1543 void Arguments::set_heap_size() {
1544   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
1545     // Deprecated flag
1546     FLAG_SET_CMDLINE(uintx, MaxRAMFraction, DefaultMaxRAMFraction);
1547   }
1548 
1549   const julong phys_mem =
1550     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
1551                             : (julong)MaxRAM;
1552 
1553   // If the maximum heap size has not been set with -Xmx,
1554   // then set it as fraction of the size of physical memory,
1555   // respecting the maximum and minimum sizes of the heap.