< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




2283     // Settings to encourage splitting.
2284     if (!FLAG_IS_CMDLINE(NewRatio)) {
2285       FLAG_SET_CMDLINE(uintx, NewRatio, 2);
2286     }
2287     if (!FLAG_IS_CMDLINE(ScavengeBeforeFullGC)) {
2288       FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false);
2289     }
2290   }
2291 
2292   if (!(UseParallelGC || UseParallelOldGC) && FLAG_IS_DEFAULT(ScavengeBeforeFullGC)) {
2293     FLAG_SET_DEFAULT(ScavengeBeforeFullGC, false);
2294   }
2295 
2296   status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit");
2297   status = status && verify_percentage(GCTimeLimit, "GCTimeLimit");
2298   if (GCTimeLimit == 100) {
2299     // Turn off gc-overhead-limit-exceeded checks
2300     FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
2301   }
2302 
2303   status = status && ArgumentsExt::check_gc_consistency_user();
2304   status = status && check_stack_pages();
2305 
2306   status = status && verify_percentage(CMSIncrementalSafetyFactor,
2307                                     "CMSIncrementalSafetyFactor");
2308 
2309   // CMS space iteration, which FLSVerifyAllHeapreferences entails,
2310   // insists that we hold the requisite locks so that the iteration is
2311   // MT-safe. For the verification at start-up and shut-down, we don't
2312   // yet have a good way of acquiring and releasing these locks,
2313   // which are not visible at the CollectedHeap level. We want to
2314   // be able to acquire these locks and then do the iteration rather
2315   // than just disable the lock verification. This will be fixed under
2316   // bug 4788986.
2317   if (UseConcMarkSweepGC && FLSVerifyAllHeapReferences) {
2318     if (VerifyDuringStartup) {
2319       warning("Heap verification at start-up disabled "
2320               "(due to current incompatibility with FLSVerifyAllHeapReferences)");
2321       VerifyDuringStartup = false; // Disable verification at start-up
2322     }
2323 


3539   // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
3540   if (os::is_headless_jre()) {
3541     const char* headless = Arguments::get_property("java.awt.headless");
3542     if (headless == NULL) {
3543       char envbuffer[128];
3544       if (!os::getenv("JAVA_AWT_HEADLESS", envbuffer, sizeof(envbuffer))) {
3545         if (!add_property("java.awt.headless=true")) {
3546           return JNI_ENOMEM;
3547         }
3548       } else {
3549         char buffer[256];
3550         strcpy(buffer, "java.awt.headless=");
3551         strcat(buffer, envbuffer);
3552         if (!add_property(buffer)) {
3553           return JNI_ENOMEM;
3554         }
3555       }
3556     }
3557   }
3558 
3559   if (!ArgumentsExt::check_vm_args_consistency()) {
3560     return JNI_ERR;
3561   }
3562 
3563   return JNI_OK;
3564 }
3565 
3566 jint Arguments::parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p) {
3567   return parse_options_environment_variable("_JAVA_OPTIONS", scp_p,
3568                                             scp_assembly_required_p);
3569 }
3570 
3571 jint Arguments::parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p) {
3572   return parse_options_environment_variable("JAVA_TOOL_OPTIONS", scp_p,
3573                                             scp_assembly_required_p);
3574 }
3575 
3576 jint Arguments::parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p) {
3577   const int N_MAX_OPTIONS = 64;
3578   const int OPTION_BUFFER_SIZE = 1024;
3579   char buffer[OPTION_BUFFER_SIZE];


3937       vm_exit_during_initialization(
3938         "Incompatible compilation policy selected", NULL);
3939     }
3940     // Scale CompileThreshold
3941     if (!FLAG_IS_DEFAULT(CompileThresholdScaling)) {
3942       FLAG_SET_ERGO(intx, CompileThreshold, get_scaled_compile_threshold(CompileThreshold));
3943     }
3944   }
3945 
3946 #ifdef COMPILER2
3947 #ifndef PRODUCT
3948   if (PrintIdealGraphLevel > 0) {
3949     FLAG_SET_ERGO(bool, PrintIdealGraph, true);
3950   }
3951 #endif
3952 #endif
3953 
3954   // Set heap size based on available physical memory
3955   set_heap_size();
3956 
3957   set_gc_specific_flags();
3958 
3959   // Initialize Metaspace flags and alignments
3960   Metaspace::ergo_initialize();
3961 
3962   // Set bytecode rewriting flags
3963   set_bytecode_flags();
3964 
3965   // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled
3966   set_aggressive_opts_flags();
3967 
3968   // Turn off biased locking for locking debug mode flags,
3969   // which are subtly different from each other but neither works with
3970   // biased locking
3971   if (UseHeavyMonitors
3972 #ifdef COMPILER1
3973       || !UseFastLocking
3974 #endif // COMPILER1
3975     ) {
3976     if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) {
3977       // flag set to true on command line; warn the user that they




2283     // Settings to encourage splitting.
2284     if (!FLAG_IS_CMDLINE(NewRatio)) {
2285       FLAG_SET_CMDLINE(uintx, NewRatio, 2);
2286     }
2287     if (!FLAG_IS_CMDLINE(ScavengeBeforeFullGC)) {
2288       FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false);
2289     }
2290   }
2291 
2292   if (!(UseParallelGC || UseParallelOldGC) && FLAG_IS_DEFAULT(ScavengeBeforeFullGC)) {
2293     FLAG_SET_DEFAULT(ScavengeBeforeFullGC, false);
2294   }
2295 
2296   status = status && verify_percentage(GCHeapFreeLimit, "GCHeapFreeLimit");
2297   status = status && verify_percentage(GCTimeLimit, "GCTimeLimit");
2298   if (GCTimeLimit == 100) {
2299     // Turn off gc-overhead-limit-exceeded checks
2300     FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
2301   }
2302 
2303   status = status && check_gc_consistency_user();
2304   status = status && check_stack_pages();
2305 
2306   status = status && verify_percentage(CMSIncrementalSafetyFactor,
2307                                     "CMSIncrementalSafetyFactor");
2308 
2309   // CMS space iteration, which FLSVerifyAllHeapreferences entails,
2310   // insists that we hold the requisite locks so that the iteration is
2311   // MT-safe. For the verification at start-up and shut-down, we don't
2312   // yet have a good way of acquiring and releasing these locks,
2313   // which are not visible at the CollectedHeap level. We want to
2314   // be able to acquire these locks and then do the iteration rather
2315   // than just disable the lock verification. This will be fixed under
2316   // bug 4788986.
2317   if (UseConcMarkSweepGC && FLSVerifyAllHeapReferences) {
2318     if (VerifyDuringStartup) {
2319       warning("Heap verification at start-up disabled "
2320               "(due to current incompatibility with FLSVerifyAllHeapReferences)");
2321       VerifyDuringStartup = false; // Disable verification at start-up
2322     }
2323 


3539   // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
3540   if (os::is_headless_jre()) {
3541     const char* headless = Arguments::get_property("java.awt.headless");
3542     if (headless == NULL) {
3543       char envbuffer[128];
3544       if (!os::getenv("JAVA_AWT_HEADLESS", envbuffer, sizeof(envbuffer))) {
3545         if (!add_property("java.awt.headless=true")) {
3546           return JNI_ENOMEM;
3547         }
3548       } else {
3549         char buffer[256];
3550         strcpy(buffer, "java.awt.headless=");
3551         strcat(buffer, envbuffer);
3552         if (!add_property(buffer)) {
3553           return JNI_ENOMEM;
3554         }
3555       }
3556     }
3557   }
3558 
3559   if (!check_vm_args_consistency()) {
3560     return JNI_ERR;
3561   }
3562 
3563   return JNI_OK;
3564 }
3565 
3566 jint Arguments::parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p) {
3567   return parse_options_environment_variable("_JAVA_OPTIONS", scp_p,
3568                                             scp_assembly_required_p);
3569 }
3570 
3571 jint Arguments::parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p) {
3572   return parse_options_environment_variable("JAVA_TOOL_OPTIONS", scp_p,
3573                                             scp_assembly_required_p);
3574 }
3575 
3576 jint Arguments::parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p) {
3577   const int N_MAX_OPTIONS = 64;
3578   const int OPTION_BUFFER_SIZE = 1024;
3579   char buffer[OPTION_BUFFER_SIZE];


3937       vm_exit_during_initialization(
3938         "Incompatible compilation policy selected", NULL);
3939     }
3940     // Scale CompileThreshold
3941     if (!FLAG_IS_DEFAULT(CompileThresholdScaling)) {
3942       FLAG_SET_ERGO(intx, CompileThreshold, get_scaled_compile_threshold(CompileThreshold));
3943     }
3944   }
3945 
3946 #ifdef COMPILER2
3947 #ifndef PRODUCT
3948   if (PrintIdealGraphLevel > 0) {
3949     FLAG_SET_ERGO(bool, PrintIdealGraph, true);
3950   }
3951 #endif
3952 #endif
3953 
3954   // Set heap size based on available physical memory
3955   set_heap_size();
3956 
3957   ArgumentsExt::set_gc_specific_flags();
3958 
3959   // Initialize Metaspace flags and alignments
3960   Metaspace::ergo_initialize();
3961 
3962   // Set bytecode rewriting flags
3963   set_bytecode_flags();
3964 
3965   // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled
3966   set_aggressive_opts_flags();
3967 
3968   // Turn off biased locking for locking debug mode flags,
3969   // which are subtly different from each other but neither works with
3970   // biased locking
3971   if (UseHeavyMonitors
3972 #ifdef COMPILER1
3973       || !UseFastLocking
3974 #endif // COMPILER1
3975     ) {
3976     if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) {
3977       // flag set to true on command line; warn the user that they


< prev index next >