comparison src/share/vm/runtime/arguments.cpp @ 1963:0ac62b4d6507

6999491: non-zero COOPs are used when they should not Summary: HeapBaseMinAddress should be used only for a default heap size calculation. Reviewed-by: iveresov, jcoomes, dholmes
author kvn
date Fri, 12 Nov 2010 09:51:43 -0800
parents 2db84614f61d
children 4110c3e0c50d
comparison
equal deleted inserted replaced
1924:b0e6879e48fa 1963:0ac62b4d6507
1326 } 1326 }
1327 return true; 1327 return true;
1328 } 1328 }
1329 1329
1330 inline uintx max_heap_for_compressed_oops() { 1330 inline uintx max_heap_for_compressed_oops() {
1331 // Heap should be above HeapBaseMinAddress to get zero based compressed oops. 1331 // Avoid sign flip.
1332 LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size() - HeapBaseMinAddress); 1332 if (OopEncodingHeapMax < MaxPermSize + os::vm_page_size()) {
1333 return 0;
1334 }
1335 LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size());
1333 NOT_LP64(ShouldNotReachHere(); return 0); 1336 NOT_LP64(ShouldNotReachHere(); return 0);
1334 } 1337 }
1335 1338
1336 bool Arguments::should_auto_select_low_pause_collector() { 1339 bool Arguments::should_auto_select_low_pause_collector() {
1337 if (UseAutoGCSelectPolicy && 1340 if (UseAutoGCSelectPolicy &&
1505 // Limit the heap size to ErgoHeapSizeLimit 1508 // Limit the heap size to ErgoHeapSizeLimit
1506 reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit); 1509 reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit);
1507 } 1510 }
1508 if (UseCompressedOops) { 1511 if (UseCompressedOops) {
1509 // Limit the heap size to the maximum possible when using compressed oops 1512 // Limit the heap size to the maximum possible when using compressed oops
1510 reasonable_max = MIN2(reasonable_max, (julong)max_heap_for_compressed_oops()); 1513 julong max_coop_heap = (julong)max_heap_for_compressed_oops();
1514 if (HeapBaseMinAddress + MaxHeapSize < max_coop_heap) {
1515 // Heap should be above HeapBaseMinAddress to get zero based compressed oops
1516 // but it should be not less than default MaxHeapSize.
1517 max_coop_heap -= HeapBaseMinAddress;
1518 }
1519 reasonable_max = MIN2(reasonable_max, max_coop_heap);
1511 } 1520 }
1512 reasonable_max = os::allocatable_physical_memory(reasonable_max); 1521 reasonable_max = os::allocatable_physical_memory(reasonable_max);
1513 1522
1514 if (!FLAG_IS_DEFAULT(InitialHeapSize)) { 1523 if (!FLAG_IS_DEFAULT(InitialHeapSize)) {
1515 // An initial heap size was specified on the command line, 1524 // An initial heap size was specified on the command line,