96 "young-normal, concurrent-start, mixed, remark, cleanup and full", type);
97 }
98 }
99
100 void G1Arguments::initialize() {
101 GCArguments::initialize();
102 assert(UseG1GC, "Error");
103 FLAG_SET_DEFAULT(ParallelGCThreads, WorkerPolicy::parallel_worker_threads());
104 if (ParallelGCThreads == 0) {
105 assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
106 vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
107 }
108
109 // When dumping the CDS archive we want to reduce fragmentation by
110 // triggering a full collection. To get as low fragmentation as
111 // possible we only use one worker thread.
112 if (DumpSharedSpaces) {
113 FLAG_SET_ERGO(ParallelGCThreads, 1);
114 }
115
116 if (FLAG_IS_DEFAULT(G1ConcRefinementThreads)) {
117 FLAG_SET_ERGO(G1ConcRefinementThreads, ParallelGCThreads);
118 }
119
120 // MarkStackSize will be set (if it hasn't been set by the user)
121 // when concurrent marking is initialized.
122 // Its value will be based upon the number of parallel marking threads.
123 // But we do set the maximum mark stack size here.
124 if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
125 FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
126 }
127
128 if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
129 // In G1, we want the default GC overhead goal to be higher than
130 // it is for PS, or the heap might be expanded too aggressively.
131 // We set it here to ~8%.
132 FLAG_SET_DEFAULT(GCTimeRatio, 12);
133 }
134
135 // Below, we might need to calculate the pause time interval based on
136 // the pause target. When we do so we are going to give G1 maximum
|
96 "young-normal, concurrent-start, mixed, remark, cleanup and full", type);
97 }
98 }
99
100 void G1Arguments::initialize() {
101 GCArguments::initialize();
102 assert(UseG1GC, "Error");
103 FLAG_SET_DEFAULT(ParallelGCThreads, WorkerPolicy::parallel_worker_threads());
104 if (ParallelGCThreads == 0) {
105 assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
106 vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
107 }
108
109 // When dumping the CDS archive we want to reduce fragmentation by
110 // triggering a full collection. To get as low fragmentation as
111 // possible we only use one worker thread.
112 if (DumpSharedSpaces) {
113 FLAG_SET_ERGO(ParallelGCThreads, 1);
114 }
115
116 if (G1FastWriteBarrier) {
117 FLAG_SET_DEFAULT(G1ConcRefinementThreads, 0);
118 FLAG_SET_DEFAULT(G1ConcRSLogCacheSize, 0);
119 } else if (FLAG_IS_DEFAULT(G1ConcRefinementThreads)) {
120 FLAG_SET_ERGO(G1ConcRefinementThreads, ParallelGCThreads);
121 }
122
123 // MarkStackSize will be set (if it hasn't been set by the user)
124 // when concurrent marking is initialized.
125 // Its value will be based upon the number of parallel marking threads.
126 // But we do set the maximum mark stack size here.
127 if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
128 FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
129 }
130
131 if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
132 // In G1, we want the default GC overhead goal to be higher than
133 // it is for PS, or the heap might be expanded too aggressively.
134 // We set it here to ~8%.
135 FLAG_SET_DEFAULT(GCTimeRatio, 12);
136 }
137
138 // Below, we might need to calculate the pause time interval based on
139 // the pause target. When we do so we are going to give G1 maximum
|