< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




  64 #define UNSUPPORTED_GC_OPTION(gc)                                     \
  65 do {                                                                  \
  66   if (gc) {                                                           \
  67     if (FLAG_IS_CMDLINE(gc)) {                                        \
  68       warning(#gc " is not supported in this VM.  Using Serial GC."); \
  69     }                                                                 \
  70     FLAG_SET_DEFAULT(gc, false);                                      \
  71   }                                                                   \
  72 } while(0)
  73 
  74 char** Arguments::_jvm_flags_array              = NULL;
  75 int    Arguments::_num_jvm_flags                = 0;
  76 char** Arguments::_jvm_args_array               = NULL;
  77 int    Arguments::_num_jvm_args                 = 0;
  78 char*  Arguments::_java_command                 = NULL;
  79 SystemProperty* Arguments::_system_properties   = NULL;
  80 const char*  Arguments::_gc_log_filename        = NULL;
  81 bool   Arguments::_has_profile                  = false;
  82 size_t Arguments::_conservative_max_heap_alignment = 0;
  83 size_t Arguments::_min_heap_size                = 0;
  84 uintx  Arguments::_min_heap_free_ratio          = 0;
  85 uintx  Arguments::_max_heap_free_ratio          = 0;
  86 Arguments::Mode Arguments::_mode                = _mixed;
  87 bool   Arguments::_java_compiler                = false;
  88 bool   Arguments::_xdebug_mode                  = false;
  89 const char*  Arguments::_java_vendor_url_bug    = DEFAULT_VENDOR_URL_BUG;
  90 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
  91 int    Arguments::_sun_java_launcher_pid        = -1;
  92 bool   Arguments::_sun_java_launcher_is_altjvm  = false;
  93 
  94 // These parameters are reset in method parse_vm_init_args()
  95 bool   Arguments::_AlwaysCompileLoopMethods     = AlwaysCompileLoopMethods;
  96 bool   Arguments::_UseOnStackReplacement        = UseOnStackReplacement;
  97 bool   Arguments::_BackgroundCompilation        = BackgroundCompilation;
  98 bool   Arguments::_ClipInlining                 = ClipInlining;
  99 intx   Arguments::_Tier3InvokeNotifyFreqLog     = Tier3InvokeNotifyFreqLog;
 100 intx   Arguments::_Tier4InvocationThreshold     = Tier4InvocationThreshold;
 101 
 102 char*  Arguments::SharedArchivePath             = NULL;
 103 
 104 AgentLibraryList Arguments::_libraryList;
 105 AgentLibraryList Arguments::_agentList;


1597   if (FLAG_IS_DEFAULT(UseParallelOldGC)) {
1598     FLAG_SET_DEFAULT(UseParallelOldGC, true);
1599   }
1600   FLAG_SET_DEFAULT(UseParallelGC, true);
1601 
1602   // If no heap maximum was requested explicitly, use some reasonable fraction
1603   // of the physical memory, up to a maximum of 1GB.
1604   FLAG_SET_DEFAULT(ParallelGCThreads,
1605                    Abstract_VM_Version::parallel_worker_threads());
1606   if (ParallelGCThreads == 0) {
1607     jio_fprintf(defaultStream::error_stream(),
1608         "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
1609     vm_exit(1);
1610   }
1611 
1612   if (UseAdaptiveSizePolicy) {
1613     // We don't want to limit adaptive heap sizing's freedom to adjust the heap
1614     // unless the user actually sets these flags.
1615     if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) {
1616       FLAG_SET_DEFAULT(MinHeapFreeRatio, 0);
1617       _min_heap_free_ratio = MinHeapFreeRatio;
1618     }
1619     if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) {
1620       FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100);
1621       _max_heap_free_ratio = MaxHeapFreeRatio;
1622     }
1623   }
1624 
1625   // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
1626   // SurvivorRatio has been set, reset their default values to SurvivorRatio +
1627   // 2.  By doing this we make SurvivorRatio also work for Parallel Scavenger.
1628   // See CR 6362902 for details.
1629   if (!FLAG_IS_DEFAULT(SurvivorRatio)) {
1630     if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) {
1631        FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2);
1632     }
1633     if (FLAG_IS_DEFAULT(MinSurvivorRatio)) {
1634       FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2);
1635     }
1636   }
1637 
1638   if (UseParallelOldGC) {
1639     // Par compact uses lower default values since they are treated as
1640     // minimums.  These are different defaults because of the different
1641     // interpretation and are not ergonomically set.


3961     if (UseParallelGC || UseParallelOldGC) {
3962       if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
3963          FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
3964       }
3965     }
3966     // UseNUMAInterleaving is set to ON for all collectors and
3967     // platforms when UseNUMA is set to ON. NUMA-aware collectors
3968     // such as the parallel collector for Linux and Solaris will
3969     // interleave old gen and survivor spaces on top of NUMA
3970     // allocation policy for the eden space.
3971     // Non NUMA-aware collectors such as CMS, G1 and Serial-GC on
3972     // all platforms and ParallelGC on Windows will interleave all
3973     // of the heap spaces across NUMA nodes.
3974     if (FLAG_IS_DEFAULT(UseNUMAInterleaving)) {
3975       FLAG_SET_ERGO(bool, UseNUMAInterleaving, true);
3976     }
3977   }
3978   return JNI_OK;
3979 }
3980 
3981 // Any custom code post the 'CommandLineFlagConstraint::AfterErgo' constraint check
3982 // can be done here. We pass a flag that specifies whether
3983 // the check passed successfully
3984 void Arguments::post_after_ergo_constraint_check(bool check_passed) {
3985   // This does not set the flag itself, but stores the value in a safe place for later usage.
3986   _min_heap_free_ratio = MinHeapFreeRatio;
3987   _max_heap_free_ratio = MaxHeapFreeRatio;
3988 }
3989 
3990 int Arguments::PropertyList_count(SystemProperty* pl) {
3991   int count = 0;
3992   while(pl != NULL) {
3993     count++;
3994     pl = pl->next();
3995   }
3996   return count;
3997 }
3998 
3999 const char* Arguments::PropertyList_get_value(SystemProperty *pl, const char* key) {
4000   assert(key != NULL, "just checking");
4001   SystemProperty* prop;
4002   for (prop = pl; prop != NULL; prop = prop->next()) {
4003     if (strcmp(key, prop->key()) == 0) return prop->value();
4004   }
4005   return NULL;
4006 }
4007 
4008 const char* Arguments::PropertyList_get_key_at(SystemProperty *pl, int index) {
4009   int count = 0;




  64 #define UNSUPPORTED_GC_OPTION(gc)                                     \
  65 do {                                                                  \
  66   if (gc) {                                                           \
  67     if (FLAG_IS_CMDLINE(gc)) {                                        \
  68       warning(#gc " is not supported in this VM.  Using Serial GC."); \
  69     }                                                                 \
  70     FLAG_SET_DEFAULT(gc, false);                                      \
  71   }                                                                   \
  72 } while(0)
  73 
  74 char** Arguments::_jvm_flags_array              = NULL;
  75 int    Arguments::_num_jvm_flags                = 0;
  76 char** Arguments::_jvm_args_array               = NULL;
  77 int    Arguments::_num_jvm_args                 = 0;
  78 char*  Arguments::_java_command                 = NULL;
  79 SystemProperty* Arguments::_system_properties   = NULL;
  80 const char*  Arguments::_gc_log_filename        = NULL;
  81 bool   Arguments::_has_profile                  = false;
  82 size_t Arguments::_conservative_max_heap_alignment = 0;
  83 size_t Arguments::_min_heap_size                = 0;


  84 Arguments::Mode Arguments::_mode                = _mixed;
  85 bool   Arguments::_java_compiler                = false;
  86 bool   Arguments::_xdebug_mode                  = false;
  87 const char*  Arguments::_java_vendor_url_bug    = DEFAULT_VENDOR_URL_BUG;
  88 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
  89 int    Arguments::_sun_java_launcher_pid        = -1;
  90 bool   Arguments::_sun_java_launcher_is_altjvm  = false;
  91 
  92 // These parameters are reset in method parse_vm_init_args()
  93 bool   Arguments::_AlwaysCompileLoopMethods     = AlwaysCompileLoopMethods;
  94 bool   Arguments::_UseOnStackReplacement        = UseOnStackReplacement;
  95 bool   Arguments::_BackgroundCompilation        = BackgroundCompilation;
  96 bool   Arguments::_ClipInlining                 = ClipInlining;
  97 intx   Arguments::_Tier3InvokeNotifyFreqLog     = Tier3InvokeNotifyFreqLog;
  98 intx   Arguments::_Tier4InvocationThreshold     = Tier4InvocationThreshold;
  99 
 100 char*  Arguments::SharedArchivePath             = NULL;
 101 
 102 AgentLibraryList Arguments::_libraryList;
 103 AgentLibraryList Arguments::_agentList;


1595   if (FLAG_IS_DEFAULT(UseParallelOldGC)) {
1596     FLAG_SET_DEFAULT(UseParallelOldGC, true);
1597   }
1598   FLAG_SET_DEFAULT(UseParallelGC, true);
1599 
1600   // If no heap maximum was requested explicitly, use some reasonable fraction
1601   // of the physical memory, up to a maximum of 1GB.
1602   FLAG_SET_DEFAULT(ParallelGCThreads,
1603                    Abstract_VM_Version::parallel_worker_threads());
1604   if (ParallelGCThreads == 0) {
1605     jio_fprintf(defaultStream::error_stream(),
1606         "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
1607     vm_exit(1);
1608   }
1609 
1610   if (UseAdaptiveSizePolicy) {
1611     // We don't want to limit adaptive heap sizing's freedom to adjust the heap
1612     // unless the user actually sets these flags.
1613     if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) {
1614       FLAG_SET_DEFAULT(MinHeapFreeRatio, 0);

1615     }
1616     if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) {
1617       FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100);

1618     }
1619   }
1620 
1621   // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
1622   // SurvivorRatio has been set, reset their default values to SurvivorRatio +
1623   // 2.  By doing this we make SurvivorRatio also work for Parallel Scavenger.
1624   // See CR 6362902 for details.
1625   if (!FLAG_IS_DEFAULT(SurvivorRatio)) {
1626     if (FLAG_IS_DEFAULT(InitialSurvivorRatio)) {
1627        FLAG_SET_DEFAULT(InitialSurvivorRatio, SurvivorRatio + 2);
1628     }
1629     if (FLAG_IS_DEFAULT(MinSurvivorRatio)) {
1630       FLAG_SET_DEFAULT(MinSurvivorRatio, SurvivorRatio + 2);
1631     }
1632   }
1633 
1634   if (UseParallelOldGC) {
1635     // Par compact uses lower default values since they are treated as
1636     // minimums.  These are different defaults because of the different
1637     // interpretation and are not ergonomically set.


3957     if (UseParallelGC || UseParallelOldGC) {
3958       if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) {
3959          FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M);
3960       }
3961     }
3962     // UseNUMAInterleaving is set to ON for all collectors and
3963     // platforms when UseNUMA is set to ON. NUMA-aware collectors
3964     // such as the parallel collector for Linux and Solaris will
3965     // interleave old gen and survivor spaces on top of NUMA
3966     // allocation policy for the eden space.
3967     // Non NUMA-aware collectors such as CMS, G1 and Serial-GC on
3968     // all platforms and ParallelGC on Windows will interleave all
3969     // of the heap spaces across NUMA nodes.
3970     if (FLAG_IS_DEFAULT(UseNUMAInterleaving)) {
3971       FLAG_SET_ERGO(bool, UseNUMAInterleaving, true);
3972     }
3973   }
3974   return JNI_OK;
3975 }
3976 









3977 int Arguments::PropertyList_count(SystemProperty* pl) {
3978   int count = 0;
3979   while(pl != NULL) {
3980     count++;
3981     pl = pl->next();
3982   }
3983   return count;
3984 }
3985 
3986 const char* Arguments::PropertyList_get_value(SystemProperty *pl, const char* key) {
3987   assert(key != NULL, "just checking");
3988   SystemProperty* prop;
3989   for (prop = pl; prop != NULL; prop = prop->next()) {
3990     if (strcmp(key, prop->key()) == 0) return prop->value();
3991   }
3992   return NULL;
3993 }
3994 
3995 const char* Arguments::PropertyList_get_key_at(SystemProperty *pl, int index) {
3996   int count = 0;


< prev index next >