mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-19 23:48:50 +00:00
8146990: Convert CollectorPolicy to use log_warning instead of warning
Reviewed-by: sjohanss, brutisso
This commit is contained in:
parent
75f5093aa1
commit
4657994435
@ -303,7 +303,7 @@ void GenCollectorPolicy::initialize_flags() {
|
||||
|
||||
// Make sure NewSize allows an old generation to fit even if set on the command line
|
||||
if (FLAG_IS_CMDLINE(NewSize) && NewSize >= _initial_heap_byte_size) {
|
||||
warning("NewSize was set larger than initial heap size, will use initial heap size.");
|
||||
log_warning(gc, ergo)("NewSize was set larger than initial heap size, will use initial heap size.");
|
||||
NewSize = bound_minus_alignment(NewSize, _initial_heap_byte_size);
|
||||
}
|
||||
|
||||
@ -325,9 +325,9 @@ void GenCollectorPolicy::initialize_flags() {
|
||||
// Make sure there is room for an old generation
|
||||
size_t smaller_max_new_size = MaxHeapSize - _gen_alignment;
|
||||
if (FLAG_IS_CMDLINE(MaxNewSize)) {
|
||||
warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
|
||||
"heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.",
|
||||
MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
|
||||
log_warning(gc, ergo)("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
|
||||
"heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.",
|
||||
MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
|
||||
}
|
||||
FLAG_SET_ERGO(size_t, MaxNewSize, smaller_max_new_size);
|
||||
if (NewSize > MaxNewSize) {
|
||||
@ -346,9 +346,9 @@ void GenCollectorPolicy::initialize_flags() {
|
||||
// At this point this should only happen if the user specifies a large NewSize and/or
|
||||
// a small (but not too small) MaxNewSize.
|
||||
if (FLAG_IS_CMDLINE(MaxNewSize)) {
|
||||
warning("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). "
|
||||
"A new max generation size of " SIZE_FORMAT "k will be used.",
|
||||
NewSize/K, MaxNewSize/K, NewSize/K);
|
||||
log_warning(gc, ergo)("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). "
|
||||
"A new max generation size of " SIZE_FORMAT "k will be used.",
|
||||
NewSize/K, MaxNewSize/K, NewSize/K);
|
||||
}
|
||||
FLAG_SET_ERGO(size_t, MaxNewSize, NewSize);
|
||||
_max_young_size = MaxNewSize;
|
||||
@ -516,10 +516,10 @@ void GenCollectorPolicy::initialize_size_info() {
|
||||
// The generation minimums and the overall heap minimum should
|
||||
// be within one generation alignment.
|
||||
if (_initial_old_size > _max_old_size) {
|
||||
warning("Inconsistency between maximum heap size and maximum "
|
||||
"generation sizes: using maximum heap = " SIZE_FORMAT
|
||||
" -XX:OldSize flag is being ignored",
|
||||
_max_heap_byte_size);
|
||||
log_warning(gc, ergo)("Inconsistency between maximum heap size and maximum "
|
||||
"generation sizes: using maximum heap = " SIZE_FORMAT
|
||||
", -XX:OldSize flag is being ignored",
|
||||
_max_heap_byte_size);
|
||||
_initial_old_size = _max_old_size;
|
||||
}
|
||||
|
||||
@ -531,8 +531,8 @@ void GenCollectorPolicy::initialize_size_info() {
|
||||
// differs from JDK8 where the generation sizes have higher priority
|
||||
// than the initial heap size.
|
||||
if ((_initial_old_size + _initial_young_size) != _initial_heap_byte_size) {
|
||||
warning("Inconsistency between generation sizes and heap size, resizing "
|
||||
"the generations to fit the heap.");
|
||||
log_warning(gc, ergo)("Inconsistency between generation sizes and heap size, resizing "
|
||||
"the generations to fit the heap.");
|
||||
|
||||
size_t desired_young_size = _initial_heap_byte_size - _initial_old_size;
|
||||
if (_initial_heap_byte_size < _initial_old_size) {
|
||||
@ -697,8 +697,8 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
||||
// Give a warning if we seem to be looping forever.
|
||||
if ((QueuedAllocationWarningCount > 0) &&
|
||||
(try_count % QueuedAllocationWarningCount == 0)) {
|
||||
warning("GenCollectorPolicy::mem_allocate_work retries %d times \n\t"
|
||||
" size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
|
||||
log_warning(gc, ergo)("GenCollectorPolicy::mem_allocate_work retries %d times,"
|
||||
" size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -870,8 +870,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation(
|
||||
loop_count++;
|
||||
if ((QueuedAllocationWarningCount > 0) &&
|
||||
(loop_count % QueuedAllocationWarningCount == 0)) {
|
||||
warning("satisfy_failed_metadata_allocation() retries %d times \n\t"
|
||||
" size=" SIZE_FORMAT, loop_count, word_size);
|
||||
log_warning(gc, ergo)("satisfy_failed_metadata_allocation() retries %d times,"
|
||||
" size=" SIZE_FORMAT, loop_count, word_size);
|
||||
}
|
||||
} while (true); // Until a GC is done
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user