< prev index next >

src/hotspot/share/gc/parallel/parallelArguments.cpp

Print this page

  9  *
 10  * This code is distributed in the hope that it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 13  * version 2 for more details (a copy is included in the LICENSE file that
 14  * accompanied this code).
 15  *
 16  * You should have received a copy of the GNU General Public License version
 17  * 2 along with this work; if not, write to the Free Software Foundation,
 18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #include "gc/parallel/parallelArguments.hpp"
 27 #include "gc/parallel/parallelScavengeHeap.hpp"
 28 #include "gc/shared/adaptiveSizePolicy.hpp"
 29 #include "gc/shared/fullGCForwarding.hpp"
 30 #include "gc/shared/gcArguments.hpp"
 31 #include "gc/shared/genArguments.hpp"
 32 #include "gc/shared/workerPolicy.hpp"
 33 #include "logging/log.hpp"
 34 #include "runtime/globals.hpp"
 35 #include "runtime/globals_extension.hpp"
 36 #include "runtime/java.hpp"
 37 #include "utilities/defaultStream.hpp"
 38 #include "utilities/powerOfTwo.hpp"
 39 
 40 size_t ParallelArguments::conservative_max_heap_alignment() {
 41   return compute_heap_alignment();
 42 }
 43 
 44 void ParallelArguments::initialize() {
 45   GCArguments::initialize();
 46   assert(UseParallelGC, "Error");
 47 
 48   // If no heap maximum was requested explicitly, use some reasonable fraction
 49   // of the physical memory, up to a maximum of 1GB.

 77       FLAG_SET_DEFAULT(InitialSurvivorRatio, MinSurvivorRatio);
 78     }
 79   }
 80 
 81   // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
 82   // SurvivorRatio has been set, reset their default values to SurvivorRatio +
 83   // 2.  By doing this we make SurvivorRatio also work for Parallel Scavenger.
 84   // See CR 6362902 for details.
 85   if (!FLAG_IS_DEFAULT(SurvivorRatio)) {
 86     if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) {
 87        FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2);
 88     }
 89     if (FLAG_IS_DEFAULT(MinSurvivorRatio)) {
 90       FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2);
 91     }
 92   }
 93 
 94   if (FLAG_IS_DEFAULT(ParallelRefProcEnabled) && ParallelGCThreads > 1) {
 95     FLAG_SET_DEFAULT(ParallelRefProcEnabled, true);
 96   }
 97 
 98   FullGCForwarding::initialize_flags(heap_reserved_size_bytes());
 99 }
100 
101 // The alignment used for boundary between young gen and old gen
102 static size_t default_gen_alignment() {
103   return 64 * K * HeapWordSize;
104 }
105 
106 void ParallelArguments::initialize_alignments() {
107   // Initialize card size before initializing alignments
108   CardTable::initialize_card_size();
109   SpaceAlignment = GenAlignment = default_gen_alignment();
110   HeapAlignment = compute_heap_alignment();
111 }
112 
113 void ParallelArguments::initialize_heap_flags_and_sizes_one_pass() {
114   // Do basic sizing work
115   GenArguments::initialize_heap_flags_and_sizes();
116 }
117 
118 void ParallelArguments::initialize_heap_flags_and_sizes() {

  9  *
 10  * This code is distributed in the hope that it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 13  * version 2 for more details (a copy is included in the LICENSE file that
 14  * accompanied this code).
 15  *
 16  * You should have received a copy of the GNU General Public License version
 17  * 2 along with this work; if not, write to the Free Software Foundation,
 18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #include "gc/parallel/parallelArguments.hpp"
 27 #include "gc/parallel/parallelScavengeHeap.hpp"
 28 #include "gc/shared/adaptiveSizePolicy.hpp"

 29 #include "gc/shared/gcArguments.hpp"
 30 #include "gc/shared/genArguments.hpp"
 31 #include "gc/shared/workerPolicy.hpp"
 32 #include "logging/log.hpp"
 33 #include "runtime/globals.hpp"
 34 #include "runtime/globals_extension.hpp"
 35 #include "runtime/java.hpp"
 36 #include "utilities/defaultStream.hpp"
 37 #include "utilities/powerOfTwo.hpp"
 38 
 39 size_t ParallelArguments::conservative_max_heap_alignment() {
 40   return compute_heap_alignment();
 41 }
 42 
 43 void ParallelArguments::initialize() {
 44   GCArguments::initialize();
 45   assert(UseParallelGC, "Error");
 46 
 47   // If no heap maximum was requested explicitly, use some reasonable fraction
 48   // of the physical memory, up to a maximum of 1GB.

 76       FLAG_SET_DEFAULT(InitialSurvivorRatio, MinSurvivorRatio);
 77     }
 78   }
 79 
 80   // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
 81   // SurvivorRatio has been set, reset their default values to SurvivorRatio +
 82   // 2.  By doing this we make SurvivorRatio also work for Parallel Scavenger.
 83   // See CR 6362902 for details.
 84   if (!FLAG_IS_DEFAULT(SurvivorRatio)) {
 85     if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) {
 86        FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2);
 87     }
 88     if (FLAG_IS_DEFAULT(MinSurvivorRatio)) {
 89       FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2);
 90     }
 91   }
 92 
 93   if (FLAG_IS_DEFAULT(ParallelRefProcEnabled) && ParallelGCThreads > 1) {
 94     FLAG_SET_DEFAULT(ParallelRefProcEnabled, true);
 95   }


 96 }
 97 
 98 // The alignment used for boundary between young gen and old gen
 99 static size_t default_gen_alignment() {
100   return 64 * K * HeapWordSize;
101 }
102 
103 void ParallelArguments::initialize_alignments() {
104   // Initialize card size before initializing alignments
105   CardTable::initialize_card_size();
106   SpaceAlignment = GenAlignment = default_gen_alignment();
107   HeapAlignment = compute_heap_alignment();
108 }
109 
110 void ParallelArguments::initialize_heap_flags_and_sizes_one_pass() {
111   // Do basic sizing work
112   GenArguments::initialize_heap_flags_and_sizes();
113 }
114 
115 void ParallelArguments::initialize_heap_flags_and_sizes() {
< prev index next >