589 // So maximum of NewSize should be 'max_juint * 1M' 590 if (UseG1GC && (value > (max_juint * 1 * M))) { 591 CommandLineError::print(verbose, 592 "NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n", 593 value); 594 return Flag::VIOLATES_CONSTRAINT; 595 } 596 #endif // INCLUDE_ALL_GCS 597 #endif // _LP64 598 return Flag::SUCCESS; 599 } 600 601 Flag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose) { 602 // At least, alignment reserve area is needed. 603 if (value < ThreadLocalAllocBuffer::alignment_reserve_in_bytes()) { 604 CommandLineError::print(verbose, 605 "MinTLABSize (" SIZE_FORMAT ") must be " 606 "greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n", 607 value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); 608 return Flag::VIOLATES_CONSTRAINT; 609 } else { 610 return Flag::SUCCESS; 611 } 612 } 613 614 Flag::Error TLABSizeConstraintFunc(size_t value, bool verbose) { 615 // Skip for default value of zero which means set ergonomically. 616 if (FLAG_IS_CMDLINE(TLABSize)) { 617 if (value < MinTLABSize) { 618 CommandLineError::print(verbose, 619 "TLABSize (" SIZE_FORMAT ") must be " 620 "greater than or equal to MinTLABSize (" SIZE_FORMAT ")\n", 621 value, MinTLABSize); 622 return Flag::VIOLATES_CONSTRAINT; 623 } 624 if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) { 625 CommandLineError::print(verbose, 626 "TLABSize (" SIZE_FORMAT ") must be " 627 "less than or equal to ergonomic TLAB maximum size (" SIZE_FORMAT ")\n", 628 value, (ThreadLocalAllocBuffer::max_size() * HeapWordSize)); 629 return Flag::VIOLATES_CONSTRAINT; 630 } 631 } | 589 // So maximum of NewSize should be 'max_juint * 1M' 590 if (UseG1GC && (value > (max_juint * 1 * M))) { 591 CommandLineError::print(verbose, 592 "NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n", 593 value); 594 return Flag::VIOLATES_CONSTRAINT; 595 } 596 #endif // INCLUDE_ALL_GCS 597 #endif // _LP64 598 return Flag::SUCCESS; 599 } 600 601 Flag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose) { 602 // At least, alignment reserve area is needed. 603 if (value < ThreadLocalAllocBuffer::alignment_reserve_in_bytes()) { 604 CommandLineError::print(verbose, 605 "MinTLABSize (" SIZE_FORMAT ") must be " 606 "greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n", 607 value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); 608 return Flag::VIOLATES_CONSTRAINT; 609 } 610 if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) { 611 CommandLineError::print(verbose, 612 "MinTLABSize (" SIZE_FORMAT ") must be " 613 "less than or equal to ergonomic TLAB maximum (" SIZE_FORMAT ")\n", 614 value, ThreadLocalAllocBuffer::max_size() * HeapWordSize); 615 return Flag::VIOLATES_CONSTRAINT; 616 } 617 return Flag::SUCCESS; 618 } 619 620 Flag::Error TLABSizeConstraintFunc(size_t value, bool verbose) { 621 // Skip for default value of zero which means set ergonomically. 622 if (FLAG_IS_CMDLINE(TLABSize)) { 623 if (value < MinTLABSize) { 624 CommandLineError::print(verbose, 625 "TLABSize (" SIZE_FORMAT ") must be " 626 "greater than or equal to MinTLABSize (" SIZE_FORMAT ")\n", 627 value, MinTLABSize); 628 return Flag::VIOLATES_CONSTRAINT; 629 } 630 if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) { 631 CommandLineError::print(verbose, 632 "TLABSize (" SIZE_FORMAT ") must be " 633 "less than or equal to ergonomic TLAB maximum size (" SIZE_FORMAT ")\n", 634 value, (ThreadLocalAllocBuffer::max_size() * HeapWordSize)); 635 return Flag::VIOLATES_CONSTRAINT; 636 } 637 } |