< prev index next >

src/hotspot/share/memory/metaspace.cpp

Print this page

674   // Set MetaspaceSize, MinMetaspaceExpansion and MaxMetaspaceExpansion
675   if (MetaspaceSize > MaxMetaspaceSize) {
676     MetaspaceSize = MaxMetaspaceSize;
677   }
678 
679   MetaspaceSize = align_down_bounded(MetaspaceSize, commit_alignment());
680 
681   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
682 
683   MinMetaspaceExpansion = align_down_bounded(MinMetaspaceExpansion, commit_alignment());
684   MaxMetaspaceExpansion = align_down_bounded(MaxMetaspaceExpansion, commit_alignment());
685 
686 }
687 
688 void Metaspace::global_initialize() {
689   MetaspaceGC::initialize(); // <- since we do not prealloc init chunks anymore is this still needed?
690 
691   metaspace::ChunkHeaderPool::initialize();
692 
693   if (CDSConfig::is_dumping_static_archive()) {
694     assert(!UseSharedSpaces, "sanity");


695     MetaspaceShared::initialize_for_static_dump();
696   }
697 
698   // If UseCompressedClassPointers=1, we have two cases:
699   // a) if CDS is active (runtime, Xshare=on), it will create the class space
700   //    for us, initialize it and set up CompressedKlassPointers encoding.
701   //    Class space will be reserved above the mapped archives.
702   // b) if CDS either deactivated (Xshare=off) or a static dump is to be done (Xshare:dump),
703   //    we will create the class space on our own. It will be placed above the java heap,
704   //    since we assume it has been placed in low
705   //    address regions. We may rethink this (see JDK-8244943). Failing that,
706   //    it will be placed anywhere.
707 
708 #if INCLUDE_CDS
709   // case (a)
710   if (UseSharedSpaces) {
711     if (!FLAG_IS_DEFAULT(CompressedClassSpaceBaseAddress)) {
712       log_warning(metaspace)("CDS active - ignoring CompressedClassSpaceBaseAddress.");
713     }
714     MetaspaceShared::initialize_runtime_shared_and_meta_spaces();

674   // Set MetaspaceSize, MinMetaspaceExpansion and MaxMetaspaceExpansion
675   if (MetaspaceSize > MaxMetaspaceSize) {
676     MetaspaceSize = MaxMetaspaceSize;
677   }
678 
679   MetaspaceSize = align_down_bounded(MetaspaceSize, commit_alignment());
680 
681   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
682 
683   MinMetaspaceExpansion = align_down_bounded(MinMetaspaceExpansion, commit_alignment());
684   MaxMetaspaceExpansion = align_down_bounded(MaxMetaspaceExpansion, commit_alignment());
685 
686 }
687 
688 void Metaspace::global_initialize() {
689   MetaspaceGC::initialize(); // <- since we do not prealloc init chunks anymore is this still needed?
690 
691   metaspace::ChunkHeaderPool::initialize();
692 
693   if (CDSConfig::is_dumping_static_archive()) {
694     if (!CDSConfig::is_dumping_final_static_archive()) {
695       assert(!UseSharedSpaces, "sanity");
696     }
697     MetaspaceShared::initialize_for_static_dump();
698   }
699 
700   // If UseCompressedClassPointers=1, we have two cases:
701   // a) if CDS is active (runtime, Xshare=on), it will create the class space
702   //    for us, initialize it and set up CompressedKlassPointers encoding.
703   //    Class space will be reserved above the mapped archives.
704   // b) if CDS either deactivated (Xshare=off) or a static dump is to be done (Xshare:dump),
705   //    we will create the class space on our own. It will be placed above the java heap,
706   //    since we assume it has been placed in low
707   //    address regions. We may rethink this (see JDK-8244943). Failing that,
708   //    it will be placed anywhere.
709 
710 #if INCLUDE_CDS
711   // case (a)
712   if (UseSharedSpaces) {
713     if (!FLAG_IS_DEFAULT(CompressedClassSpaceBaseAddress)) {
714       log_warning(metaspace)("CDS active - ignoring CompressedClassSpaceBaseAddress.");
715     }
716     MetaspaceShared::initialize_runtime_shared_and_meta_spaces();
< prev index next >