comparison src/share/vm/runtime/arguments.cpp @ 4838:a5244e07b761

7112413: JVM Crash, possibly GC-related Summary: disable UseAdaptiveSizePolicy with the CMS and ParNew Reviewed-by: johnc, brutisso
author jcoomes
date Wed, 25 Jan 2012 21:14:11 -0800
parents 865e0817f32b
children 0a10d80352d5
comparison
equal deleted inserted replaced
4837:eff609af17d7 4838:a5244e07b761
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
1038 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); 1038 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2);
1039 } 1039 }
1040 } 1040 }
1041 1041
1042 #ifndef KERNEL 1042 #ifndef KERNEL
1043 static void disable_adaptive_size_policy(const char* collector_name) {
1044 if (UseAdaptiveSizePolicy) {
1045 if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
1046 warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
1047 collector_name);
1048 }
1049 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
1050 }
1051 }
1052
1043 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC 1053 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC
1044 // if it's not explictly set or unset. If the user has chosen 1054 // if it's not explictly set or unset. If the user has chosen
1045 // UseParNewGC and not explicitly set ParallelGCThreads we 1055 // UseParNewGC and not explicitly set ParallelGCThreads we
1046 // set it, unless this is a single cpu machine. 1056 // set it, unless this is a single cpu machine.
1047 void Arguments::set_parnew_gc_flags() { 1057 void Arguments::set_parnew_gc_flags() {
1048 assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC, 1058 assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC,
1049 "control point invariant"); 1059 "control point invariant");
1050 assert(UseParNewGC, "Error"); 1060 assert(UseParNewGC, "Error");
1051 1061
1052 // Turn off AdaptiveSizePolicy by default for parnew until it is 1062 // Turn off AdaptiveSizePolicy for parnew until it is complete.
1053 // complete. 1063 disable_adaptive_size_policy("UseParNewGC");
1054 if (FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) {
1055 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
1056 }
1057 1064
1058 if (ParallelGCThreads == 0) { 1065 if (ParallelGCThreads == 0) {
1059 FLAG_SET_DEFAULT(ParallelGCThreads, 1066 FLAG_SET_DEFAULT(ParallelGCThreads,
1060 Abstract_VM_Version::parallel_worker_threads()); 1067 Abstract_VM_Version::parallel_worker_threads());
1061 if (ParallelGCThreads == 1) { 1068 if (ParallelGCThreads == 1) {
1108 // unless explicitly forbidden. 1115 // unless explicitly forbidden.
1109 if (FLAG_IS_DEFAULT(UseParNewGC)) { 1116 if (FLAG_IS_DEFAULT(UseParNewGC)) {
1110 FLAG_SET_ERGO(bool, UseParNewGC, true); 1117 FLAG_SET_ERGO(bool, UseParNewGC, true);
1111 } 1118 }
1112 1119
1113 // Turn off AdaptiveSizePolicy by default for cms until it is 1120 // Turn off AdaptiveSizePolicy for CMS until it is complete.
1114 // complete. 1121 disable_adaptive_size_policy("UseConcMarkSweepGC");
1115 if (FLAG_IS_DEFAULT(UseAdaptiveSizePolicy)) {
1116 FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
1117 }
1118 1122
1119 // In either case, adjust ParallelGCThreads and/or UseParNewGC 1123 // In either case, adjust ParallelGCThreads and/or UseParNewGC
1120 // as needed. 1124 // as needed.
1121 if (UseParNewGC) { 1125 if (UseParNewGC) {
1122 set_parnew_gc_flags(); 1126 set_parnew_gc_flags();