Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/arguments.cpp @ 1145:e018e6884bd8
6631166: CMS: better heuristics when combatting fragmentation
Summary: Autonomic per-worker free block cache sizing, tunable coalition policies, fixes to per-size block statistics, retuned gain and bandwidth of some feedback loop filters to allow quicker reactivity to abrupt changes in ambient demand, and other heuristics to reduce fragmentation of the CMS old gen. Also tightened some assertions, including those related to locking.
Reviewed-by: jmasa
author | ysr |
---|---|
date | Wed, 23 Dec 2009 09:23:54 -0800 |
parents | 84cb6f20afb3 |
children | 75bd253e25dd |
comparison
equal
deleted
inserted
replaced
1111:44f61c24ddab | 1145:e018e6884bd8 |
---|---|
946 } else { | 946 } else { |
947 FLAG_SET_DEFAULT(UseSharedSpaces, false); | 947 FLAG_SET_DEFAULT(UseSharedSpaces, false); |
948 } | 948 } |
949 } | 949 } |
950 | 950 |
951 #ifndef KERNEL | |
951 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC | 952 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC |
952 // if it's not explictly set or unset. If the user has chosen | 953 // if it's not explictly set or unset. If the user has chosen |
953 // UseParNewGC and not explicitly set ParallelGCThreads we | 954 // UseParNewGC and not explicitly set ParallelGCThreads we |
954 // set it, unless this is a single cpu machine. | 955 // set it, unless this is a single cpu machine. |
955 void Arguments::set_parnew_gc_flags() { | 956 void Arguments::set_parnew_gc_flags() { |
1175 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim | 1176 // OldPLABSize is not the default value but CMSParPromoteBlocksToClaim |
1176 // is. In this situtation let CMSParPromoteBlocksToClaim follow | 1177 // is. In this situtation let CMSParPromoteBlocksToClaim follow |
1177 // the value (either from the command line or ergonomics) of | 1178 // the value (either from the command line or ergonomics) of |
1178 // OldPLABSize. Following OldPLABSize is an ergonomics decision. | 1179 // OldPLABSize. Following OldPLABSize is an ergonomics decision. |
1179 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize); | 1180 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, OldPLABSize); |
1180 } | 1181 } else { |
1181 else { | |
1182 // OldPLABSize and CMSParPromoteBlocksToClaim are both set. | 1182 // OldPLABSize and CMSParPromoteBlocksToClaim are both set. |
1183 // CMSParPromoteBlocksToClaim is a collector-specific flag, so | 1183 // CMSParPromoteBlocksToClaim is a collector-specific flag, so |
1184 // we'll let it to take precedence. | 1184 // we'll let it to take precedence. |
1185 jio_fprintf(defaultStream::error_stream(), | 1185 jio_fprintf(defaultStream::error_stream(), |
1186 "Both OldPLABSize and CMSParPromoteBlocksToClaim" | 1186 "Both OldPLABSize and CMSParPromoteBlocksToClaim" |
1187 " options are specified for the CMS collector." | 1187 " options are specified for the CMS collector." |
1188 " CMSParPromoteBlocksToClaim will take precedence.\n"); | 1188 " CMSParPromoteBlocksToClaim will take precedence.\n"); |
1189 } | 1189 } |
1190 } | 1190 } |
1191 } | 1191 if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) { |
1192 // OldPLAB sizing manually turned off: Use a larger default setting, | |
1193 // unless it was manually specified. This is because a too-low value | |
1194 // will slow down scavenges. | |
1195 if (FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim)) { | |
1196 FLAG_SET_ERGO(uintx, CMSParPromoteBlocksToClaim, 50); // default value before 6631166 | |
1197 } | |
1198 } | |
1199 // Overwrite OldPLABSize which is the variable we will internally use everywhere. | |
1200 FLAG_SET_ERGO(uintx, OldPLABSize, CMSParPromoteBlocksToClaim); | |
1201 // If either of the static initialization defaults have changed, note this | |
1202 // modification. | |
1203 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) { | |
1204 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); | |
1205 } | |
1206 } | |
1207 #endif // KERNEL | |
1192 | 1208 |
1193 inline uintx max_heap_for_compressed_oops() { | 1209 inline uintx max_heap_for_compressed_oops() { |
1194 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); | 1210 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); |
1195 NOT_LP64(ShouldNotReachHere(); return 0); | 1211 NOT_LP64(ShouldNotReachHere(); return 0); |
1196 } | 1212 } |
2368 #else // ndef SOLARIS | 2384 #else // ndef SOLARIS |
2369 jio_fprintf(defaultStream::error_stream(), | 2385 jio_fprintf(defaultStream::error_stream(), |
2370 "ExtendedDTraceProbes flag is only applicable on Solaris\n"); | 2386 "ExtendedDTraceProbes flag is only applicable on Solaris\n"); |
2371 return JNI_EINVAL; | 2387 return JNI_EINVAL; |
2372 #endif // ndef SOLARIS | 2388 #endif // ndef SOLARIS |
2373 } else | |
2374 #ifdef ASSERT | 2389 #ifdef ASSERT |
2375 if (match_option(option, "-XX:+FullGCALot", &tail)) { | 2390 } else if (match_option(option, "-XX:+FullGCALot", &tail)) { |
2376 FLAG_SET_CMDLINE(bool, FullGCALot, true); | 2391 FLAG_SET_CMDLINE(bool, FullGCALot, true); |
2377 // disable scavenge before parallel mark-compact | 2392 // disable scavenge before parallel mark-compact |
2378 FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); | 2393 FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); |
2379 } else | |
2380 #endif | 2394 #endif |
2381 if (match_option(option, "-XX:ParCMSPromoteBlocksToClaim=", &tail)) { | 2395 } else if (match_option(option, "-XX:CMSParPromoteBlocksToClaim=", &tail)) { |
2382 julong cms_blocks_to_claim = (julong)atol(tail); | 2396 julong cms_blocks_to_claim = (julong)atol(tail); |
2383 FLAG_SET_CMDLINE(uintx, CMSParPromoteBlocksToClaim, cms_blocks_to_claim); | 2397 FLAG_SET_CMDLINE(uintx, CMSParPromoteBlocksToClaim, cms_blocks_to_claim); |
2384 jio_fprintf(defaultStream::error_stream(), | 2398 jio_fprintf(defaultStream::error_stream(), |
2385 "Please use -XX:CMSParPromoteBlocksToClaim in place of " | 2399 "Please use -XX:OldPLABSize in place of " |
2400 "-XX:CMSParPromoteBlocksToClaim in the future\n"); | |
2401 } else if (match_option(option, "-XX:ParCMSPromoteBlocksToClaim=", &tail)) { | |
2402 julong cms_blocks_to_claim = (julong)atol(tail); | |
2403 FLAG_SET_CMDLINE(uintx, CMSParPromoteBlocksToClaim, cms_blocks_to_claim); | |
2404 jio_fprintf(defaultStream::error_stream(), | |
2405 "Please use -XX:OldPLABSize in place of " | |
2386 "-XX:ParCMSPromoteBlocksToClaim in the future\n"); | 2406 "-XX:ParCMSPromoteBlocksToClaim in the future\n"); |
2387 } else | 2407 } else if (match_option(option, "-XX:ParallelGCOldGenAllocBufferSize=", &tail)) { |
2388 if (match_option(option, "-XX:ParallelGCOldGenAllocBufferSize=", &tail)) { | |
2389 julong old_plab_size = 0; | 2408 julong old_plab_size = 0; |
2390 ArgsRange errcode = parse_memory_size(tail, &old_plab_size, 1); | 2409 ArgsRange errcode = parse_memory_size(tail, &old_plab_size, 1); |
2391 if (errcode != arg_in_range) { | 2410 if (errcode != arg_in_range) { |
2392 jio_fprintf(defaultStream::error_stream(), | 2411 jio_fprintf(defaultStream::error_stream(), |
2393 "Invalid old PLAB size: %s\n", option->optionString); | 2412 "Invalid old PLAB size: %s\n", option->optionString); |
2396 } | 2415 } |
2397 FLAG_SET_CMDLINE(uintx, OldPLABSize, old_plab_size); | 2416 FLAG_SET_CMDLINE(uintx, OldPLABSize, old_plab_size); |
2398 jio_fprintf(defaultStream::error_stream(), | 2417 jio_fprintf(defaultStream::error_stream(), |
2399 "Please use -XX:OldPLABSize in place of " | 2418 "Please use -XX:OldPLABSize in place of " |
2400 "-XX:ParallelGCOldGenAllocBufferSize in the future\n"); | 2419 "-XX:ParallelGCOldGenAllocBufferSize in the future\n"); |
2401 } else | 2420 } else if (match_option(option, "-XX:ParallelGCToSpaceAllocBufferSize=", &tail)) { |
2402 if (match_option(option, "-XX:ParallelGCToSpaceAllocBufferSize=", &tail)) { | |
2403 julong young_plab_size = 0; | 2421 julong young_plab_size = 0; |
2404 ArgsRange errcode = parse_memory_size(tail, &young_plab_size, 1); | 2422 ArgsRange errcode = parse_memory_size(tail, &young_plab_size, 1); |
2405 if (errcode != arg_in_range) { | 2423 if (errcode != arg_in_range) { |
2406 jio_fprintf(defaultStream::error_stream(), | 2424 jio_fprintf(defaultStream::error_stream(), |
2407 "Invalid young PLAB size: %s\n", option->optionString); | 2425 "Invalid young PLAB size: %s\n", option->optionString); |
2410 } | 2428 } |
2411 FLAG_SET_CMDLINE(uintx, YoungPLABSize, young_plab_size); | 2429 FLAG_SET_CMDLINE(uintx, YoungPLABSize, young_plab_size); |
2412 jio_fprintf(defaultStream::error_stream(), | 2430 jio_fprintf(defaultStream::error_stream(), |
2413 "Please use -XX:YoungPLABSize in place of " | 2431 "Please use -XX:YoungPLABSize in place of " |
2414 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n"); | 2432 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n"); |
2415 } else | 2433 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx |
2416 if (match_option(option, "-XX:", &tail)) { // -XX:xxxx | |
2417 // Skip -XX:Flags= since that case has already been handled | 2434 // Skip -XX:Flags= since that case has already been handled |
2418 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { | 2435 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { |
2419 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { | 2436 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { |
2420 return JNI_EINVAL; | 2437 return JNI_EINVAL; |
2421 } | 2438 } |
2725 // Check the GC selections again. | 2742 // Check the GC selections again. |
2726 if (!check_gc_consistency()) { | 2743 if (!check_gc_consistency()) { |
2727 return JNI_EINVAL; | 2744 return JNI_EINVAL; |
2728 } | 2745 } |
2729 | 2746 |
2747 #ifndef KERNEL | |
2730 if (UseConcMarkSweepGC) { | 2748 if (UseConcMarkSweepGC) { |
2731 // Set flags for CMS and ParNew. Check UseConcMarkSweep first | 2749 // Set flags for CMS and ParNew. Check UseConcMarkSweep first |
2732 // to ensure that when both UseConcMarkSweepGC and UseParNewGC | 2750 // to ensure that when both UseConcMarkSweepGC and UseParNewGC |
2733 // are true, we don't call set_parnew_gc_flags() as well. | 2751 // are true, we don't call set_parnew_gc_flags() as well. |
2734 set_cms_and_parnew_gc_flags(); | 2752 set_cms_and_parnew_gc_flags(); |
2742 set_parnew_gc_flags(); | 2760 set_parnew_gc_flags(); |
2743 } else if (UseG1GC) { | 2761 } else if (UseG1GC) { |
2744 set_g1_gc_flags(); | 2762 set_g1_gc_flags(); |
2745 } | 2763 } |
2746 } | 2764 } |
2765 #endif // KERNEL | |
2747 | 2766 |
2748 #ifdef SERIALGC | 2767 #ifdef SERIALGC |
2749 assert(verify_serial_gc_flags(), "SerialGC unset"); | 2768 assert(verify_serial_gc_flags(), "SerialGC unset"); |
2750 #endif // SERIALGC | 2769 #endif // SERIALGC |
2751 | 2770 |