< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

1587       if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
1588         warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
1589         FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1590       }
1591     }
1592   }
1593 #endif // _LP64
1594 }
1595 
1596 void Arguments::set_conservative_max_heap_alignment() {
1597   // The conservative maximum required alignment for the heap is the maximum of
1598   // the alignments imposed by several sources: any requirements from the heap
1599   // itself and the maximum page size we may run the VM with.
1600   size_t heap_alignment = GCConfig::arguments()->conservative_max_heap_alignment();
1601   _conservative_max_heap_alignment = MAX4(heap_alignment,
1602                                           (size_t)os::vm_allocation_granularity(),
1603                                           os::max_page_size(),
1604                                           GCArguments::compute_heap_alignment());
1605 }
1606 






1607 jint Arguments::set_ergonomics_flags() {
1608   GCConfig::initialize();
1609 
1610   set_conservative_max_heap_alignment();
1611 
1612 #ifdef _LP64
1613   set_use_compressed_oops();
1614 
1615   // set_use_compressed_klass_ptrs() must be called after calling
1616   // set_use_compressed_oops().
1617   set_use_compressed_klass_ptrs();
1618 
1619   // Also checks that certain machines are slower with compressed oops
1620   // in vm_version initialization code.
1621 #endif // _LP64
1622 


1623   return JNI_OK;
1624 }
1625 
1626 size_t Arguments::limit_heap_by_allocatable_memory(size_t limit) {
1627   size_t max_allocatable;
1628   size_t result = limit;
1629   if (os::has_allocatable_memory_limit(&max_allocatable)) {
1630     // The AggressiveHeap check is a temporary workaround to avoid calling
1631     // GCarguments::heap_virtual_to_physical_ratio() before a GC has been
1632     // selected. This works because AggressiveHeap implies UseParallelGC
1633     // where we know the ratio will be 1. Once the AggressiveHeap option is
1634     // removed, this can be cleaned up.
1635     size_t heap_virtual_to_physical_ratio = (AggressiveHeap ? 1 : GCConfig::arguments()->heap_virtual_to_physical_ratio());
1636     size_t fraction = MaxVirtMemFraction * heap_virtual_to_physical_ratio;
1637     result = MIN2(result, max_allocatable / fraction);
1638   }
1639   return result;
1640 }
1641 
1642 // Use static initialization to get the default before parsing

4004   // Initialize Metaspace flags and alignments
4005   Metaspace::ergo_initialize();
4006 
4007   if (!StringDedup::ergo_initialize()) {
4008     return JNI_EINVAL;
4009   }
4010 
4011   // Set compiler flags after GC is selected and GC specific
4012   // flags (LoopStripMiningIter) are set.
4013   CompilerConfig::ergo_initialize();
4014 
4015   // Set bytecode rewriting flags
4016   set_bytecode_flags();
4017 
4018   // Set flags if aggressive optimization flags are enabled
4019   jint code = set_aggressive_opts_flags();
4020   if (code != JNI_OK) {
4021     return code;
4022   }
4023 







4024 #ifdef ZERO
4025   // Clear flags not supported on zero.
4026   FLAG_SET_DEFAULT(ProfileInterpreter, false);
4027 
4028   if (LogTouchedMethods) {
4029     warning("LogTouchedMethods is not supported for Zero");
4030     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4031   }
4032 #endif // ZERO
4033 
4034   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4035     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4036     DebugNonSafepoints = true;
4037   }
4038 
4039   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4040     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4041   }
4042 
4043   // Treat the odd case where local verification is enabled but remote

1587       if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
1588         warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
1589         FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
1590       }
1591     }
1592   }
1593 #endif // _LP64
1594 }
1595 
1596 void Arguments::set_conservative_max_heap_alignment() {
1597   // The conservative maximum required alignment for the heap is the maximum of
1598   // the alignments imposed by several sources: any requirements from the heap
1599   // itself and the maximum page size we may run the VM with.
1600   size_t heap_alignment = GCConfig::arguments()->conservative_max_heap_alignment();
1601   _conservative_max_heap_alignment = MAX4(heap_alignment,
1602                                           (size_t)os::vm_allocation_granularity(),
1603                                           os::max_page_size(),
1604                                           GCArguments::compute_heap_alignment());
1605 }
1606 
1607 void Arguments::set_use_chunk_bitmaps() {
1608   if (FLAG_IS_DEFAULT(UseChunkBitmaps)) {
1609     FLAG_SET_ERGO(UseChunkBitmaps, UseG1GC || UseParallelGC || UseSerialGC);
1610   }
1611 }
1612 
1613 jint Arguments::set_ergonomics_flags() {
1614   GCConfig::initialize();
1615 
1616   set_conservative_max_heap_alignment();
1617 
1618 #ifdef _LP64
1619   set_use_compressed_oops();
1620 
1621   // set_use_compressed_klass_ptrs() must be called after calling
1622   // set_use_compressed_oops().
1623   set_use_compressed_klass_ptrs();
1624 
1625   // Also checks that certain machines are slower with compressed oops
1626   // in vm_version initialization code.
1627 #endif // _LP64
1628 
1629   set_use_chunk_bitmaps();
1630 
1631   return JNI_OK;
1632 }
1633 
1634 size_t Arguments::limit_heap_by_allocatable_memory(size_t limit) {
1635   size_t max_allocatable;
1636   size_t result = limit;
1637   if (os::has_allocatable_memory_limit(&max_allocatable)) {
1638     // The AggressiveHeap check is a temporary workaround to avoid calling
1639     // GCarguments::heap_virtual_to_physical_ratio() before a GC has been
1640     // selected. This works because AggressiveHeap implies UseParallelGC
1641     // where we know the ratio will be 1. Once the AggressiveHeap option is
1642     // removed, this can be cleaned up.
1643     size_t heap_virtual_to_physical_ratio = (AggressiveHeap ? 1 : GCConfig::arguments()->heap_virtual_to_physical_ratio());
1644     size_t fraction = MaxVirtMemFraction * heap_virtual_to_physical_ratio;
1645     result = MIN2(result, max_allocatable / fraction);
1646   }
1647   return result;
1648 }
1649 
1650 // Use static initialization to get the default before parsing

4012   // Initialize Metaspace flags and alignments
4013   Metaspace::ergo_initialize();
4014 
4015   if (!StringDedup::ergo_initialize()) {
4016     return JNI_EINVAL;
4017   }
4018 
4019   // Set compiler flags after GC is selected and GC specific
4020   // flags (LoopStripMiningIter) are set.
4021   CompilerConfig::ergo_initialize();
4022 
4023   // Set bytecode rewriting flags
4024   set_bytecode_flags();
4025 
4026   // Set flags if aggressive optimization flags are enabled
4027   jint code = set_aggressive_opts_flags();
4028   if (code != JNI_OK) {
4029     return code;
4030   }
4031 
4032   if (_mode == _int) {
4033     if (SegmentedCodeCache) {
4034       warning("SegmentedCodeCache has no meaningful effect with -Xint");
4035       FLAG_SET_DEFAULT(SegmentedCodeCache, false);
4036     }
4037   }
4038 
4039 #ifdef ZERO
4040   // Clear flags not supported on zero.
4041   FLAG_SET_DEFAULT(ProfileInterpreter, false);
4042 
4043   if (LogTouchedMethods) {
4044     warning("LogTouchedMethods is not supported for Zero");
4045     FLAG_SET_DEFAULT(LogTouchedMethods, false);
4046   }
4047 #endif // ZERO
4048 
4049   if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
4050     warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
4051     DebugNonSafepoints = true;
4052   }
4053 
4054   if (FLAG_IS_CMDLINE(CompressedClassSpaceSize) && !UseCompressedClassPointers) {
4055     warning("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used");
4056   }
4057 
4058   // Treat the odd case where local verification is enabled but remote
< prev index next >