1420 }
1421 // It does not make sense to have big object alignment
1422 // since a space lost due to alignment will be greater
1423 // then a saved space from compressed oops.
1424 if ((int)ObjectAlignmentInBytes > 256) {
1425 jio_fprintf(defaultStream::error_stream(),
1426 "error: ObjectAlignmentInBytes=%d must not be greater than 256\n",
1427 (int)ObjectAlignmentInBytes);
1428 return false;
1429 }
1430 // In case page size is very small.
1431 if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) {
1432 jio_fprintf(defaultStream::error_stream(),
1433 "error: ObjectAlignmentInBytes=%d must be less than page size %d\n",
1434 (int)ObjectAlignmentInBytes, os::vm_page_size());
1435 return false;
1436 }
1437 return true;
1438 }
1439
1440 uintx Arguments::max_heap_for_compressed_oops() {
1441 // Avoid sign flip.
1442 assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1443 // We need to fit both the NULL page and the heap into the memory budget, while
1444 // keeping alignment constraints of the heap. To guarantee the latter, as the
1445 // NULL page is located before the heap, we pad the NULL page to the conservative
1446 // maximum alignment that the GC may ever impose upon the heap.
1447 size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(),
1448 _conservative_max_heap_alignment);
1449
1450 LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1451 NOT_LP64(ShouldNotReachHere(); return 0);
1452 }
1453
1454 bool Arguments::should_auto_select_low_pause_collector() {
1455 if (UseAutoGCSelectPolicy &&
1456 !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1457 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1458 if (PrintGCDetails) {
1459 // Cannot use gclog_or_tty yet.
1460 tty->print_cr("Automatic selection of the low pause collector"
|
1420 }
1421 // It does not make sense to have big object alignment
1422 // since a space lost due to alignment will be greater
1423 // then a saved space from compressed oops.
1424 if ((int)ObjectAlignmentInBytes > 256) {
1425 jio_fprintf(defaultStream::error_stream(),
1426 "error: ObjectAlignmentInBytes=%d must not be greater than 256\n",
1427 (int)ObjectAlignmentInBytes);
1428 return false;
1429 }
1430 // In case page size is very small.
1431 if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) {
1432 jio_fprintf(defaultStream::error_stream(),
1433 "error: ObjectAlignmentInBytes=%d must be less than page size %d\n",
1434 (int)ObjectAlignmentInBytes, os::vm_page_size());
1435 return false;
1436 }
1437 return true;
1438 }
1439
1440 size_t Arguments::max_heap_for_compressed_oops() {
1441 // Avoid sign flip.
1442 assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1443 // We need to fit both the NULL page and the heap into the memory budget, while
1444 // keeping alignment constraints of the heap. To guarantee the latter, as the
1445 // NULL page is located before the heap, we pad the NULL page to the conservative
1446 // maximum alignment that the GC may ever impose upon the heap.
1447 size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(),
1448 _conservative_max_heap_alignment);
1449
1450 LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1451 NOT_LP64(ShouldNotReachHere(); return 0);
1452 }
1453
1454 bool Arguments::should_auto_select_low_pause_collector() {
1455 if (UseAutoGCSelectPolicy &&
1456 !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1457 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1458 if (PrintGCDetails) {
1459 // Cannot use gclog_or_tty yet.
1460 tty->print_cr("Automatic selection of the low pause collector"
|