comparison src/share/vm/runtime/arguments.cpp @ 20345:f933a15469d4

8055006: Store original value of Min/MaxHeapFreeRatio Summary: Store the value set by the user and some makefile changes required to change the flags. Reviewed-by: sla, mchung, bchristi, jmasa, dholmes
author jwilhelm
date Mon, 28 Jul 2014 22:43:08 +0200
parents ee019285a52c
children 3374ec4c4448
comparison
equal deleted inserted replaced
20344:2fd0fd493045 20345:f933a15469d4
96 SystemProperty* Arguments::_system_properties = NULL; 96 SystemProperty* Arguments::_system_properties = NULL;
97 const char* Arguments::_gc_log_filename = NULL; 97 const char* Arguments::_gc_log_filename = NULL;
98 bool Arguments::_has_profile = false; 98 bool Arguments::_has_profile = false;
99 size_t Arguments::_conservative_max_heap_alignment = 0; 99 size_t Arguments::_conservative_max_heap_alignment = 0;
100 uintx Arguments::_min_heap_size = 0; 100 uintx Arguments::_min_heap_size = 0;
101 uintx Arguments::_min_heap_free_ratio = 0;
102 uintx Arguments::_max_heap_free_ratio = 0;
101 Arguments::Mode Arguments::_mode = _mixed; 103 Arguments::Mode Arguments::_mode = _mixed;
102 bool Arguments::_java_compiler = false; 104 bool Arguments::_java_compiler = false;
103 bool Arguments::_xdebug_mode = false; 105 bool Arguments::_xdebug_mode = false;
104 const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG; 106 const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
105 const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER; 107 const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
1594 if (UseAdaptiveSizePolicy) { 1596 if (UseAdaptiveSizePolicy) {
1595 // We don't want to limit adaptive heap sizing's freedom to adjust the heap 1597 // We don't want to limit adaptive heap sizing's freedom to adjust the heap
1596 // unless the user actually sets these flags. 1598 // unless the user actually sets these flags.
1597 if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) { 1599 if (FLAG_IS_DEFAULT(MinHeapFreeRatio)) {
1598 FLAG_SET_DEFAULT(MinHeapFreeRatio, 0); 1600 FLAG_SET_DEFAULT(MinHeapFreeRatio, 0);
1601 _min_heap_free_ratio = MinHeapFreeRatio;
1599 } 1602 }
1600 if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) { 1603 if (FLAG_IS_DEFAULT(MaxHeapFreeRatio)) {
1601 FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100); 1604 FLAG_SET_DEFAULT(MaxHeapFreeRatio, 100);
1605 _max_heap_free_ratio = MaxHeapFreeRatio;
1602 } 1606 }
1603 } 1607 }
1604 1608
1605 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the 1609 // If InitialSurvivorRatio or MinSurvivorRatio were not specified, but the
1606 // SurvivorRatio has been set, reset their default values to SurvivorRatio + 1610 // SurvivorRatio has been set, reset their default values to SurvivorRatio +
1971 err_msg.print("MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " 1975 err_msg.print("MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
1972 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")", min_heap_free_ratio, 1976 "equal to MaxHeapFreeRatio (" UINTX_FORMAT ")", min_heap_free_ratio,
1973 MaxHeapFreeRatio); 1977 MaxHeapFreeRatio);
1974 return false; 1978 return false;
1975 } 1979 }
1980 // This does not set the flag itself, but stores the value in a safe place for later usage.
1981 _min_heap_free_ratio = min_heap_free_ratio;
1976 return true; 1982 return true;
1977 } 1983 }
1978 1984
1979 bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio) { 1985 bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio) {
1980 if (!is_percentage(max_heap_free_ratio)) { 1986 if (!is_percentage(max_heap_free_ratio)) {
1985 err_msg.print("MaxHeapFreeRatio (" UINTX_FORMAT ") must be greater than or " 1991 err_msg.print("MaxHeapFreeRatio (" UINTX_FORMAT ") must be greater than or "
1986 "equal to MinHeapFreeRatio (" UINTX_FORMAT ")", max_heap_free_ratio, 1992 "equal to MinHeapFreeRatio (" UINTX_FORMAT ")", max_heap_free_ratio,
1987 MinHeapFreeRatio); 1993 MinHeapFreeRatio);
1988 return false; 1994 return false;
1989 } 1995 }
1996 // This does not set the flag itself, but stores the value in a safe place for later usage.
1997 _max_heap_free_ratio = max_heap_free_ratio;
1990 return true; 1998 return true;
1991 } 1999 }
1992 2000
1993 // Check consistency of GC selection 2001 // Check consistency of GC selection
1994 bool Arguments::check_gc_consistency() { 2002 bool Arguments::check_gc_consistency() {