mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8025856: Fix typos in the GC code
Fix about 440 typos in comments in the VM code Reviewed-by: mgerdin, tschatzl, coleenp, kmo, jcoomes
This commit is contained in:
parent
4c7c3f0613
commit
81ba2e32c0
150 changed files with 524 additions and 545 deletions
|
@ -45,7 +45,7 @@
|
|||
#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
// CollectorPolicy methods.
|
||||
// CollectorPolicy methods
|
||||
|
||||
CollectorPolicy::CollectorPolicy() :
|
||||
_space_alignment(0),
|
||||
|
@ -185,7 +185,7 @@ size_t CollectorPolicy::compute_heap_alignment() {
|
|||
// other collectors should also be updated to do their own alignment and then
|
||||
// this use of lcm() should be removed.
|
||||
if (UseLargePages && !UseParallelGC) {
|
||||
// in presence of large pages we have to make sure that our
|
||||
// In presence of large pages we have to make sure that our
|
||||
// alignment is large page aware
|
||||
alignment = lcm(os::large_page_size(), alignment);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ size_t CollectorPolicy::compute_heap_alignment() {
|
|||
return alignment;
|
||||
}
|
||||
|
||||
// GenCollectorPolicy methods.
|
||||
// GenCollectorPolicy methods
|
||||
|
||||
GenCollectorPolicy::GenCollectorPolicy() :
|
||||
_min_gen0_size(0),
|
||||
|
@ -375,10 +375,10 @@ void TwoGenerationCollectorPolicy::initialize_flags() {
|
|||
_initial_heap_byte_size = InitialHeapSize;
|
||||
}
|
||||
|
||||
// adjust max heap size if necessary
|
||||
// Adjust NewSize and OldSize or MaxHeapSize to match each other
|
||||
if (NewSize + OldSize > MaxHeapSize) {
|
||||
if (_max_heap_size_cmdline) {
|
||||
// somebody set a maximum heap size with the intention that we should not
|
||||
// Somebody has set a maximum heap size with the intention that we should not
|
||||
// exceed it. Adjust New/OldSize as necessary.
|
||||
uintx calculated_size = NewSize + OldSize;
|
||||
double shrink_factor = (double) MaxHeapSize / calculated_size;
|
||||
|
@ -439,9 +439,8 @@ void GenCollectorPolicy::initialize_size_info() {
|
|||
// minimum gen0 sizes.
|
||||
|
||||
if (_max_heap_byte_size == _min_heap_byte_size) {
|
||||
// The maximum and minimum heap sizes are the same so
|
||||
// the generations minimum and initial must be the
|
||||
// same as its maximum.
|
||||
// The maximum and minimum heap sizes are the same so the generations
|
||||
// minimum and initial must be the same as its maximum.
|
||||
_min_gen0_size = max_new_size;
|
||||
_initial_gen0_size = max_new_size;
|
||||
_max_gen0_size = max_new_size;
|
||||
|
@ -463,8 +462,7 @@ void GenCollectorPolicy::initialize_size_info() {
|
|||
// For the case where NewSize is the default, use NewRatio
|
||||
// to size the minimum and initial generation sizes.
|
||||
// Use the default NewSize as the floor for these values. If
|
||||
// NewRatio is overly large, the resulting sizes can be too
|
||||
// small.
|
||||
// NewRatio is overly large, the resulting sizes can be too small.
|
||||
_min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), NewSize);
|
||||
desired_new_size =
|
||||
MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize);
|
||||
|
@ -483,8 +481,7 @@ void GenCollectorPolicy::initialize_size_info() {
|
|||
_max_gen0_size = bound_minus_alignment(_max_gen0_size, _max_heap_byte_size);
|
||||
|
||||
// At this point all three sizes have been checked against the
|
||||
// maximum sizes but have not been checked for consistency
|
||||
// among the three.
|
||||
// maximum sizes but have not been checked for consistency among the three.
|
||||
|
||||
// Final check min <= initial <= max
|
||||
_min_gen0_size = MIN2(_min_gen0_size, _max_gen0_size);
|
||||
|
@ -492,7 +489,7 @@ void GenCollectorPolicy::initialize_size_info() {
|
|||
_min_gen0_size = MIN2(_min_gen0_size, _initial_gen0_size);
|
||||
}
|
||||
|
||||
// Write back to flags if necessary
|
||||
// Write back to flags if necessary.
|
||||
if (NewSize != _initial_gen0_size) {
|
||||
FLAG_SET_ERGO(uintx, NewSize, _initial_gen0_size);
|
||||
}
|
||||
|
@ -538,7 +535,7 @@ bool TwoGenerationCollectorPolicy::adjust_gen0_sizes(size_t* gen0_size_ptr,
|
|||
}
|
||||
|
||||
// Minimum sizes of the generations may be different than
|
||||
// the initial sizes. An inconsistently is permitted here
|
||||
// the initial sizes. An inconsistency is permitted here
|
||||
// in the total size that can be specified explicitly by
|
||||
// command line specification of OldSize and NewSize and
|
||||
// also a command line specification of -Xms. Issue a warning
|
||||
|
@ -550,12 +547,12 @@ void TwoGenerationCollectorPolicy::initialize_size_info() {
|
|||
// At this point the minimum, initial and maximum sizes
|
||||
// of the overall heap and of gen0 have been determined.
|
||||
// The maximum gen1 size can be determined from the maximum gen0
|
||||
// and maximum heap size since no explicit flags exits
|
||||
// and maximum heap size since no explicit flags exist
|
||||
// for setting the gen1 maximum.
|
||||
_max_gen1_size = MAX2(_max_heap_byte_size - _max_gen0_size, _gen_alignment);
|
||||
|
||||
// If no explicit command line flag has been set for the
|
||||
// gen1 size, use what is left for gen1.
|
||||
// gen1 size, use what is left for gen1
|
||||
if (!FLAG_IS_CMDLINE(OldSize)) {
|
||||
// The user has not specified any value but the ergonomics
|
||||
// may have chosen a value (which may or may not be consistent
|
||||
|
@ -567,14 +564,14 @@ void TwoGenerationCollectorPolicy::initialize_size_info() {
|
|||
// _max_gen1_size has already been made consistent above
|
||||
FLAG_SET_ERGO(uintx, OldSize, _initial_gen1_size);
|
||||
} else {
|
||||
// It's been explicitly set on the command line. Use the
|
||||
// OldSize has been explicitly set on the command line. Use the
|
||||
// OldSize and then determine the consequences.
|
||||
_min_gen1_size = MIN2(OldSize, _min_heap_byte_size - _min_gen0_size);
|
||||
_initial_gen1_size = OldSize;
|
||||
|
||||
// If the user has explicitly set an OldSize that is inconsistent
|
||||
// with other command line flags, issue a warning.
|
||||
// The generation minimums and the overall heap mimimum should
|
||||
// The generation minimums and the overall heap minimum should
|
||||
// be within one generation alignment.
|
||||
if ((_min_gen1_size + _min_gen0_size + _gen_alignment) < _min_heap_byte_size) {
|
||||
warning("Inconsistency between minimum heap size and minimum "
|
||||
|
@ -596,7 +593,7 @@ void TwoGenerationCollectorPolicy::initialize_size_info() {
|
|||
_min_gen0_size, _initial_gen0_size, _max_gen0_size);
|
||||
}
|
||||
}
|
||||
// Initial size
|
||||
// The same as above for the old gen initial size.
|
||||
if (adjust_gen0_sizes(&_initial_gen0_size, &_initial_gen1_size,
|
||||
_initial_heap_byte_size)) {
|
||||
if (PrintGCDetails && Verbose) {
|
||||
|
@ -606,10 +603,10 @@ void TwoGenerationCollectorPolicy::initialize_size_info() {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Enforce the maximum gen1 size.
|
||||
|
||||
_min_gen1_size = MIN2(_min_gen1_size, _max_gen1_size);
|
||||
|
||||
// Check that min gen1 <= initial gen1 <= max gen1
|
||||
// Make sure that min gen1 <= initial gen1 <= max gen1.
|
||||
_initial_gen1_size = MAX2(_initial_gen1_size, _min_gen1_size);
|
||||
_initial_gen1_size = MIN2(_initial_gen1_size, _max_gen1_size);
|
||||
|
||||
|
@ -650,10 +647,9 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||
|
||||
HeapWord* result = NULL;
|
||||
|
||||
// Loop until the allocation is satisified,
|
||||
// or unsatisfied after GC.
|
||||
// Loop until the allocation is satisfied, or unsatisfied after GC.
|
||||
for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
|
||||
HandleMark hm; // discard any handles allocated in each iteration
|
||||
HandleMark hm; // Discard any handles allocated in each iteration.
|
||||
|
||||
// First allocation attempt is lock-free.
|
||||
Generation *gen0 = gch->get_gen(0);
|
||||
|
@ -666,7 +662,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||
return result;
|
||||
}
|
||||
}
|
||||
unsigned int gc_count_before; // read inside the Heap_lock locked region
|
||||
unsigned int gc_count_before; // Read inside the Heap_lock locked region.
|
||||
{
|
||||
MutexLocker ml(Heap_lock);
|
||||
if (PrintGC && Verbose) {
|
||||
|
@ -685,19 +681,19 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||
|
||||
if (GC_locker::is_active_and_needs_gc()) {
|
||||
if (is_tlab) {
|
||||
return NULL; // Caller will retry allocating individual object
|
||||
return NULL; // Caller will retry allocating individual object.
|
||||
}
|
||||
if (!gch->is_maximal_no_gc()) {
|
||||
// Try and expand heap to satisfy request
|
||||
// Try and expand heap to satisfy request.
|
||||
result = expand_heap_and_allocate(size, is_tlab);
|
||||
// result could be null if we are out of space
|
||||
// Result could be null if we are out of space.
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if (gclocker_stalled_count > GCLockerRetryAllocationCount) {
|
||||
return NULL; // we didn't get to do a GC and we didn't get any memory
|
||||
return NULL; // We didn't get to do a GC and we didn't get any memory.
|
||||
}
|
||||
|
||||
// If this thread is not in a jni critical section, we stall
|
||||
|
@ -732,7 +728,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size,
|
|||
result = op.result();
|
||||
if (op.gc_locked()) {
|
||||
assert(result == NULL, "must be NULL if gc_locked() is true");
|
||||
continue; // retry and/or stall as necessary
|
||||
continue; // Retry and/or stall as necessary.
|
||||
}
|
||||
|
||||
// Allocation has failed and a collection
|
||||
|
@ -793,7 +789,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size,
|
|||
if (!gch->is_maximal_no_gc()) {
|
||||
result = expand_heap_and_allocate(size, is_tlab);
|
||||
}
|
||||
return result; // could be null if we are out of space
|
||||
return result; // Could be null if we are out of space.
|
||||
} else if (!gch->incremental_collection_will_fail(false /* don't consult_young */)) {
|
||||
// Do an incremental collection.
|
||||
gch->do_collection(false /* full */,
|
||||
|
@ -915,10 +911,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation(
|
|||
GCCause::_metadata_GC_threshold);
|
||||
VMThread::execute(&op);
|
||||
|
||||
// If GC was locked out, try again. Check
|
||||
// before checking success because the prologue
|
||||
// could have succeeded and the GC still have
|
||||
// been locked out.
|
||||
// If GC was locked out, try again. Check before checking success because the
|
||||
// prologue could have succeeded and the GC still have been locked out.
|
||||
if (op.gc_locked()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -979,7 +973,7 @@ void MarkSweepPolicy::initialize_generations() {
|
|||
}
|
||||
|
||||
void MarkSweepPolicy::initialize_gc_policy_counters() {
|
||||
// initialize the policy counters - 2 collectors, 3 generations
|
||||
// Initialize the policy counters - 2 collectors, 3 generations.
|
||||
if (UseParNewGC) {
|
||||
_gc_policy_counters = new GCPolicyCounters("ParNew:MSC", 2, 3);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue