Skip to content

Commit a855224

Browse files
JonasNorlinderThomas Schatzl
authored andcommitted
8373695: G1: Using a value near integer max for ActiveProcessorCount causes fatal crash
Reviewed-by: stefank, tschatzl
1 parent 4231328 commit a855224

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hotspot/share/gc/g1/g1Arguments.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "gc/shared/fullGCForwarding.hpp"
3737
#include "gc/shared/gcArguments.hpp"
3838
#include "gc/shared/workerPolicy.hpp"
39+
#include "runtime/flags/jvmFlagLimit.hpp"
3940
#include "runtime/globals.hpp"
4041
#include "runtime/globals_extension.hpp"
4142
#include "runtime/java.hpp"
@@ -190,7 +191,8 @@ void G1Arguments::initialize() {
190191
}
191192
FLAG_SET_DEFAULT(G1ConcRefinementThreads, 0);
192193
} else if (FLAG_IS_DEFAULT(G1ConcRefinementThreads)) {
193-
FLAG_SET_ERGO(G1ConcRefinementThreads, ParallelGCThreads);
194+
const JVMTypedFlagLimit<uint>* conc_refinement_threads_limits = JVMFlagLimit::get_range_at(FLAG_MEMBER_ENUM(G1ConcRefinementThreads))->cast<uint>();
195+
FLAG_SET_ERGO(G1ConcRefinementThreads, MIN2(ParallelGCThreads, conc_refinement_threads_limits->max()));
194196
}
195197

196198
if (FLAG_IS_DEFAULT(ConcGCThreads) || ConcGCThreads == 0) {

0 commit comments

Comments
 (0)