< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page




1720 
1721 
1722 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1723 // set_use_compressed_oops().
1724 void Arguments::set_use_compressed_klass_ptrs() {
1725 #ifndef ZERO
1726 #ifdef _LP64
1727   // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1728   if (!UseCompressedOops) {
1729     if (UseCompressedClassPointers) {
1730       warning("UseCompressedClassPointers requires UseCompressedOops");
1731     }
1732     FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1733   } else {
1734     // Turn on UseCompressedClassPointers too
1735     if (FLAG_IS_DEFAULT(UseCompressedClassPointers)) {
1736       FLAG_SET_ERGO(bool, UseCompressedClassPointers, true);
1737     }
1738     // Check the CompressedClassSpaceSize to make sure we use compressed klass ptrs.
1739     if (UseCompressedClassPointers) {










1740       if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
1741         warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
1742         FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1743       }
1744     }
1745   }
1746 #endif // _LP64
1747 #endif // !ZERO
1748 }
1749 
1750 void Arguments::set_conservative_max_heap_alignment() {
1751   // The conservative maximum required alignment for the heap is the maximum of
1752   // the alignments imposed by several sources: any requirements from the heap
1753   // itself, the collector policy and the maximum page size we may run the VM
1754   // with.
1755   size_t heap_alignment = GenCollectedHeap::conservative_max_heap_alignment();
1756 #if INCLUDE_ALL_GCS
1757   if (UseParallelGC) {
1758     heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
1759   } else if (UseG1GC) {




1720 
1721 
1722 // NOTE: set_use_compressed_klass_ptrs() must be called after calling
1723 // set_use_compressed_oops().
1724 void Arguments::set_use_compressed_klass_ptrs() {
1725 #ifndef ZERO
1726 #ifdef _LP64
1727   // UseCompressedOops must be on for UseCompressedClassPointers to be on.
1728   if (!UseCompressedOops) {
1729     if (UseCompressedClassPointers) {
1730       warning("UseCompressedClassPointers requires UseCompressedOops");
1731     }
1732     FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1733   } else {
1734     // Turn on UseCompressedClassPointers too
1735     if (FLAG_IS_DEFAULT(UseCompressedClassPointers)) {
1736       FLAG_SET_ERGO(bool, UseCompressedClassPointers, true);
1737     }
1738     // Check the CompressedClassSpaceSize to make sure we use compressed klass ptrs.
1739     if (UseCompressedClassPointers) {
1740       size_t min_metaspace_sz = Metaspace::calculate_min_metaspace_size();
1741       if ((min_metaspace_sz + CompressedClassSpaceSize) >  MaxMetaspaceSize) {
1742         if (min_metaspace_sz >= MaxMetaspaceSize) {
1743           vm_exit_during_initialization("MaxMetaspaceSize is too small.");
1744         } else {
1745           FLAG_SET_ERGO(size_t, CompressedClassSpaceSize,
1746                                         MaxMetaspaceSize - min_metaspace_sz);
1747         }
1748       }
1749 
1750       if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
1751         warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
1752         FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1753       }
1754     }
1755   }
1756 #endif // _LP64
1757 #endif // !ZERO
1758 }
1759 
1760 void Arguments::set_conservative_max_heap_alignment() {
1761   // The conservative maximum required alignment for the heap is the maximum of
1762   // the alignments imposed by several sources: any requirements from the heap
1763   // itself, the collector policy and the maximum page size we may run the VM
1764   // with.
1765   size_t heap_alignment = GenCollectedHeap::conservative_max_heap_alignment();
1766 #if INCLUDE_ALL_GCS
1767   if (UseParallelGC) {
1768     heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
1769   } else if (UseG1GC) {


< prev index next >