mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8074459: Flags handling memory sizes should be of type size_t
Changed the type to size_t for flags that handles memory sizes Reviewed-by: kbarrett, tschatzl
This commit is contained in:
parent
9f7fa061c5
commit
c1bc0a31b2
38 changed files with 267 additions and 267 deletions
|
@ -67,16 +67,16 @@ do { \
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
char** Arguments::_jvm_flags_array = NULL;
|
||||
int Arguments::_num_jvm_flags = 0;
|
||||
char** Arguments::_jvm_args_array = NULL;
|
||||
int Arguments::_num_jvm_args = 0;
|
||||
char** Arguments::_jvm_flags_array = NULL;
|
||||
int Arguments::_num_jvm_flags = 0;
|
||||
char** Arguments::_jvm_args_array = NULL;
|
||||
int Arguments::_num_jvm_args = 0;
|
||||
char* Arguments::_java_command = NULL;
|
||||
SystemProperty* Arguments::_system_properties = NULL;
|
||||
const char* Arguments::_gc_log_filename = NULL;
|
||||
bool Arguments::_has_profile = false;
|
||||
size_t Arguments::_conservative_max_heap_alignment = 0;
|
||||
uintx Arguments::_min_heap_size = 0;
|
||||
size_t Arguments::_min_heap_size = 0;
|
||||
uintx Arguments::_min_heap_free_ratio = 0;
|
||||
uintx Arguments::_max_heap_free_ratio = 0;
|
||||
Arguments::Mode Arguments::_mode = _mixed;
|
||||
|
@ -1343,9 +1343,9 @@ void Arguments::set_cms_and_parnew_gc_flags() {
|
|||
// NewSize was set on the command line and it is larger than
|
||||
// preferred_max_new_size.
|
||||
if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line
|
||||
FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
|
||||
FLAG_SET_ERGO(size_t, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
|
||||
} else {
|
||||
FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
|
||||
FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size);
|
||||
}
|
||||
if (PrintGCDetails && Verbose) {
|
||||
// Too early to use gclog_or_tty
|
||||
|
@ -1368,8 +1368,8 @@ void Arguments::set_cms_and_parnew_gc_flags() {
|
|||
// Unless explicitly requested otherwise, make young gen
|
||||
// at least min_new, and at most preferred_max_new_size.
|
||||
if (FLAG_IS_DEFAULT(NewSize)) {
|
||||
FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
|
||||
FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
|
||||
FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new));
|
||||
FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize));
|
||||
if (PrintGCDetails && Verbose) {
|
||||
// Too early to use gclog_or_tty
|
||||
tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
|
||||
|
@ -1379,7 +1379,7 @@ void Arguments::set_cms_and_parnew_gc_flags() {
|
|||
// so it's NewRatio x of NewSize.
|
||||
if (FLAG_IS_DEFAULT(OldSize)) {
|
||||
if (max_heap > NewSize) {
|
||||
FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
|
||||
FLAG_SET_ERGO(size_t, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
|
||||
if (PrintGCDetails && Verbose) {
|
||||
// Too early to use gclog_or_tty
|
||||
tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);
|
||||
|
@ -1410,7 +1410,7 @@ void Arguments::set_cms_and_parnew_gc_flags() {
|
|||
// OldPLAB sizing manually turned off: Use a larger default setting,
|
||||
// unless it was manually specified. This is because a too-low value
|
||||
// will slow down scavenges.
|
||||
FLAG_SET_ERGO(uintx, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
|
||||
FLAG_SET_ERGO(size_t, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166
|
||||
} else {
|
||||
FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
|
||||
}
|
||||
|
@ -1790,7 +1790,7 @@ julong Arguments::limit_by_allocatable_memory(julong limit) {
|
|||
}
|
||||
|
||||
// Use static initialization to get the default before parsing
|
||||
static const uintx DefaultHeapBaseMinAddress = HeapBaseMinAddress;
|
||||
static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
|
||||
|
||||
void Arguments::set_heap_size() {
|
||||
if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
|
||||
|
@ -1830,14 +1830,14 @@ void Arguments::set_heap_size() {
|
|||
// matches compressed oops printing flags
|
||||
if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"HeapBaseMinAddress must be at least " UINTX_FORMAT
|
||||
" (" UINTX_FORMAT "G) which is greater than value given "
|
||||
UINTX_FORMAT "\n",
|
||||
"HeapBaseMinAddress must be at least " SIZE_FORMAT
|
||||
" (" SIZE_FORMAT "G) which is greater than value given "
|
||||
SIZE_FORMAT "\n",
|
||||
DefaultHeapBaseMinAddress,
|
||||
DefaultHeapBaseMinAddress/G,
|
||||
HeapBaseMinAddress);
|
||||
}
|
||||
FLAG_SET_ERGO(uintx, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
|
||||
FLAG_SET_ERGO(size_t, HeapBaseMinAddress, DefaultHeapBaseMinAddress);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1862,7 +1862,7 @@ void Arguments::set_heap_size() {
|
|||
// Cannot use gclog_or_tty yet.
|
||||
tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
|
||||
}
|
||||
FLAG_SET_ERGO(uintx, MaxHeapSize, (uintx)reasonable_max);
|
||||
FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max);
|
||||
}
|
||||
|
||||
// If the minimum or initial heap_size have not been set or requested to be set
|
||||
|
@ -1884,14 +1884,14 @@ void Arguments::set_heap_size() {
|
|||
|
||||
if (PrintGCDetails && Verbose) {
|
||||
// Cannot use gclog_or_tty yet.
|
||||
tty->print_cr(" Initial heap size " SIZE_FORMAT, (uintx)reasonable_initial);
|
||||
tty->print_cr(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
|
||||
}
|
||||
FLAG_SET_ERGO(uintx, InitialHeapSize, (uintx)reasonable_initial);
|
||||
FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial);
|
||||
}
|
||||
// If the minimum heap size has not been set (via -Xms),
|
||||
// synchronize with InitialHeapSize to avoid errors with the default value.
|
||||
if (min_heap_size() == 0) {
|
||||
set_min_heap_size(MIN2((uintx)reasonable_minimum, InitialHeapSize));
|
||||
set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize));
|
||||
if (PrintGCDetails && Verbose) {
|
||||
// Cannot use gclog_or_tty yet.
|
||||
tty->print_cr(" Minimum heap size " SIZE_FORMAT, min_heap_size());
|
||||
|
@ -2037,7 +2037,7 @@ void check_gclog_consistency() {
|
|||
}
|
||||
|
||||
if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) {
|
||||
FLAG_SET_CMDLINE(uintx, GCLogFileSize, 8*K);
|
||||
FLAG_SET_CMDLINE(size_t, GCLogFileSize, 8*K);
|
||||
jio_fprintf(defaultStream::output_stream(),
|
||||
"GCLogFileSize changed to minimum 8K\n");
|
||||
}
|
||||
|
@ -2394,7 +2394,7 @@ bool Arguments::check_vm_args_consistency() {
|
|||
|
||||
status = status && verify_min_value(LogEventsBufferEntries, 1, "LogEventsBufferEntries");
|
||||
|
||||
status = status && verify_min_value(HeapSizePerGCThread, (uintx) os::vm_page_size(), "HeapSizePerGCThread");
|
||||
status = status && verify_min_value(HeapSizePerGCThread, (size_t) os::vm_page_size(), "HeapSizePerGCThread");
|
||||
|
||||
status = status && verify_min_value(GCTaskTimeStampEntries, 1, "GCTaskTimeStampEntries");
|
||||
|
||||
|
@ -2809,8 +2809,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
describe_range_error(errcode);
|
||||
return JNI_EINVAL;
|
||||
}
|
||||
FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size);
|
||||
FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size);
|
||||
FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size);
|
||||
FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size);
|
||||
// -Xms
|
||||
} else if (match_option(option, "-Xms", &tail)) {
|
||||
julong long_initial_heap_size = 0;
|
||||
|
@ -2822,10 +2822,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
describe_range_error(errcode);
|
||||
return JNI_EINVAL;
|
||||
}
|
||||
set_min_heap_size((uintx)long_initial_heap_size);
|
||||
set_min_heap_size((size_t)long_initial_heap_size);
|
||||
// Currently the minimum size and the initial heap sizes are the same.
|
||||
// Can be overridden with -XX:InitialHeapSize.
|
||||
FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
|
||||
FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size);
|
||||
// -Xmx
|
||||
} else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
|
||||
julong long_max_heap_size = 0;
|
||||
|
@ -2836,7 +2836,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
describe_range_error(errcode);
|
||||
return JNI_EINVAL;
|
||||
}
|
||||
FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
|
||||
FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size);
|
||||
// Xmaxf
|
||||
} else if (match_option(option, "-Xmaxf", &tail)) {
|
||||
char* err;
|
||||
|
@ -2977,7 +2977,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
|
||||
FLAG_SET_CMDLINE(intx, DeferThrSuspendLoopCount, 1);
|
||||
FLAG_SET_CMDLINE(bool, UseTLAB, false);
|
||||
FLAG_SET_CMDLINE(uintx, NewSizeThreadIncrease, 16 * K); // 20Kb per thread added to new generation
|
||||
FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K); // 20Kb per thread added to new generation
|
||||
|
||||
// -Xinternalversion
|
||||
} else if (match_option(option, "-Xinternalversion")) {
|
||||
|
@ -3138,16 +3138,16 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
initHeapSize = limit_by_allocatable_memory(initHeapSize);
|
||||
|
||||
if (FLAG_IS_DEFAULT(MaxHeapSize)) {
|
||||
FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize);
|
||||
FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize);
|
||||
FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize);
|
||||
FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize);
|
||||
// Currently the minimum size and the initial heap sizes are the same.
|
||||
set_min_heap_size(initHeapSize);
|
||||
}
|
||||
if (FLAG_IS_DEFAULT(NewSize)) {
|
||||
// Make the young generation 3/8ths of the total heap.
|
||||
FLAG_SET_CMDLINE(uintx, NewSize,
|
||||
FLAG_SET_CMDLINE(size_t, NewSize,
|
||||
((julong)MaxHeapSize / (julong)8) * (julong)3);
|
||||
FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize);
|
||||
FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize);
|
||||
}
|
||||
|
||||
#ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD.
|
||||
|
@ -3155,14 +3155,14 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
#endif
|
||||
|
||||
// Increase some data structure sizes for efficiency
|
||||
FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize);
|
||||
FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize);
|
||||
FLAG_SET_CMDLINE(bool, ResizeTLAB, false);
|
||||
FLAG_SET_CMDLINE(uintx, TLABSize, 256*K);
|
||||
FLAG_SET_CMDLINE(size_t, TLABSize, 256*K);
|
||||
|
||||
// See the OldPLABSize comment below, but replace 'after promotion'
|
||||
// with 'after copying'. YoungPLABSize is the size of the survivor
|
||||
// space per-gc-thread buffers. The default is 4kw.
|
||||
FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256*K); // Note: this is in words
|
||||
FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256*K); // Note: this is in words
|
||||
|
||||
// OldPLABSize is the size of the buffers in the old gen that
|
||||
// UseParallelGC uses to promote live data that doesn't fit in the
|
||||
|
@ -3177,7 +3177,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
// locality. A minor effect may be that larger PLABs reduce the
|
||||
// number of PLAB allocation events during gc. The value of 8kw
|
||||
// was arrived at by experimenting with specjbb.
|
||||
FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K); // Note: this is in words
|
||||
FLAG_SET_CMDLINE(size_t, OldPLABSize, 8*K); // Note: this is in words
|
||||
|
||||
// Enable parallel GC and adaptive generation sizing
|
||||
FLAG_SET_CMDLINE(bool, UseParallelGC, true);
|
||||
|
@ -3256,7 +3256,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Please use -XX:MarkStackSize in place of "
|
||||
"-XX:CMSMarkStackSize or -XX:G1MarkStackSize in the future\n");
|
||||
FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size);
|
||||
FLAG_SET_CMDLINE(size_t, MarkStackSize, stack_size);
|
||||
} else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) {
|
||||
julong max_stack_size = 0;
|
||||
ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1);
|
||||
|
@ -3270,7 +3270,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Please use -XX:MarkStackSizeMax in place of "
|
||||
"-XX:CMSMarkStackSizeMax in the future\n");
|
||||
FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size);
|
||||
FLAG_SET_CMDLINE(size_t, MarkStackSizeMax, max_stack_size);
|
||||
} else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) ||
|
||||
match_option(option, "-XX:ParallelCMSThreads=", &tail)) {
|
||||
uintx conc_threads = 0;
|
||||
|
@ -3293,7 +3293,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
|||
describe_range_error(errcode);
|
||||
return JNI_EINVAL;
|
||||
}
|
||||
FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
|
||||
FLAG_SET_CMDLINE(size_t, MaxDirectMemorySize, max_direct_memory_size);
|
||||
#if !INCLUDE_MANAGEMENT
|
||||
} else if (match_option(option, "-XX:+ManagementServer")) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue