1384 }
1385 // It does not make sense to have big object alignment
1386 // since a space lost due to alignment will be greater
1387 // then a saved space from compressed oops.
1388 if ((int)ObjectAlignmentInBytes > 256) {
1389 jio_fprintf(defaultStream::error_stream(),
1390 "error: ObjectAlignmentInBytes=%d must not be greater than 256\n",
1391 (int)ObjectAlignmentInBytes);
1392 return false;
1393 }
1394 // In case page size is very small.
1395 if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) {
1396 jio_fprintf(defaultStream::error_stream(),
1397 "error: ObjectAlignmentInBytes=%d must be less than page size %d\n",
1398 (int)ObjectAlignmentInBytes, os::vm_page_size());
1399 return false;
1400 }
1401 return true;
1402 }
1403
1404 uintx Arguments::max_heap_for_compressed_oops() {
1405 // Avoid sign flip.
1406 assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1407 // We need to fit both the NULL page and the heap into the memory budget, while
1408 // keeping alignment constraints of the heap. To guarantee the latter, as the
1409 // NULL page is located before the heap, we pad the NULL page to the conservative
1410 // maximum alignment that the GC may ever impose upon the heap.
1411 size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(),
1412 _conservative_max_heap_alignment);
1413
1414 LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1415 NOT_LP64(ShouldNotReachHere(); return 0);
1416 }
1417
1418 bool Arguments::should_auto_select_low_pause_collector() {
1419 if (UseAutoGCSelectPolicy &&
1420 !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1421 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1422 if (PrintGCDetails) {
1423 // Cannot use gclog_or_tty yet.
1424 tty->print_cr("Automatic selection of the low pause collector"
|
1384 }
1385 // It does not make sense to have big object alignment
1386 // since a space lost due to alignment will be greater
1387 // then a saved space from compressed oops.
1388 if ((int)ObjectAlignmentInBytes > 256) {
1389 jio_fprintf(defaultStream::error_stream(),
1390 "error: ObjectAlignmentInBytes=%d must not be greater than 256\n",
1391 (int)ObjectAlignmentInBytes);
1392 return false;
1393 }
1394 // In case page size is very small.
1395 if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) {
1396 jio_fprintf(defaultStream::error_stream(),
1397 "error: ObjectAlignmentInBytes=%d must be less than page size %d\n",
1398 (int)ObjectAlignmentInBytes, os::vm_page_size());
1399 return false;
1400 }
1401 return true;
1402 }
1403
1404 size_t Arguments::max_heap_for_compressed_oops() {
1405 // Avoid sign flip.
1406 assert(OopEncodingHeapMax > (uint64_t)os::vm_page_size(), "Unusual page size");
1407 // We need to fit both the NULL page and the heap into the memory budget, while
1408 // keeping alignment constraints of the heap. To guarantee the latter, as the
1409 // NULL page is located before the heap, we pad the NULL page to the conservative
1410 // maximum alignment that the GC may ever impose upon the heap.
1411 size_t displacement_due_to_null_page = align_size_up_(os::vm_page_size(),
1412 _conservative_max_heap_alignment);
1413
1414 LP64_ONLY(return OopEncodingHeapMax - displacement_due_to_null_page);
1415 NOT_LP64(ShouldNotReachHere(); return 0);
1416 }
1417
1418 bool Arguments::should_auto_select_low_pause_collector() {
1419 if (UseAutoGCSelectPolicy &&
1420 !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1421 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1422 if (PrintGCDetails) {
1423 // Cannot use gclog_or_tty yet.
1424 tty->print_cr("Automatic selection of the low pause collector"
|