< prev index next >

src/share/vm/gc/parallel/psYoungGen.cpp

Print this page

        

*** 114,124 **** if (UseAdaptiveSizePolicy) { max_survivor_size = size / MinSurvivorRatio; // round the survivor space size down to the nearest alignment // and make sure its size is greater than 0. ! max_survivor_size = align_size_down(max_survivor_size, alignment); max_survivor_size = MAX2(max_survivor_size, alignment); // set the maximum size of eden to be the size of the young gen // less two times the minimum survivor size. The minimum survivor // size for UseAdaptiveSizePolicy is one alignment. --- 114,124 ---- if (UseAdaptiveSizePolicy) { max_survivor_size = size / MinSurvivorRatio; // round the survivor space size down to the nearest alignment // and make sure its size is greater than 0. ! max_survivor_size = align_down(max_survivor_size, alignment); max_survivor_size = MAX2(max_survivor_size, alignment); // set the maximum size of eden to be the size of the young gen // less two times the minimum survivor size. The minimum survivor // size for UseAdaptiveSizePolicy is one alignment.
*** 126,136 **** } else { max_survivor_size = size / InitialSurvivorRatio; // round the survivor space size down to the nearest alignment // and make sure its size is greater than 0. ! max_survivor_size = align_size_down(max_survivor_size, alignment); max_survivor_size = MAX2(max_survivor_size, alignment); // set the maximum size of eden to be the size of the young gen // less two times the survivor size when the generation is 100% // committed. The minimum survivor size for -UseAdaptiveSizePolicy --- 126,136 ---- } else { max_survivor_size = size / InitialSurvivorRatio; // round the survivor space size down to the nearest alignment // and make sure its size is greater than 0. ! max_survivor_size = align_down(max_survivor_size, alignment); max_survivor_size = MAX2(max_survivor_size, alignment); // set the maximum size of eden to be the size of the young gen // less two times the survivor size when the generation is 100% // committed. The minimum survivor size for -UseAdaptiveSizePolicy
*** 160,170 **** size_t alignment = heap->space_alignment(); size_t size = virtual_space()->committed_size(); assert(size >= 3 * alignment, "Young space is not large enough for eden + 2 survivors"); size_t survivor_size = size / InitialSurvivorRatio; ! survivor_size = align_size_down(survivor_size, alignment); // ... but never less than an alignment survivor_size = MAX2(survivor_size, alignment); // Young generation is eden + 2 survivor spaces size_t eden_size = size - (2 * survivor_size); --- 160,170 ---- size_t alignment = heap->space_alignment(); size_t size = virtual_space()->committed_size(); assert(size >= 3 * alignment, "Young space is not large enough for eden + 2 survivors"); size_t survivor_size = size / InitialSurvivorRatio; ! survivor_size = align_down(survivor_size, alignment); // ... but never less than an alignment survivor_size = MAX2(survivor_size, alignment); // Young generation is eden + 2 survivor spaces size_t eden_size = size - (2 * survivor_size);
*** 191,203 **** char *to_start = eden_start + eden_size; char *from_start = to_start + survivor_size; char *from_end = from_start + survivor_size; assert(from_end == virtual_space()->high(), "just checking"); ! assert(is_ptr_object_aligned(eden_start), "checking alignment"); ! assert(is_ptr_object_aligned(to_start), "checking alignment"); ! assert(is_ptr_object_aligned(from_start), "checking alignment"); MemRegion eden_mr((HeapWord*)eden_start, (HeapWord*)to_start); MemRegion to_mr ((HeapWord*)to_start, (HeapWord*)from_start); MemRegion from_mr((HeapWord*)from_start, (HeapWord*)from_end); --- 191,203 ---- char *to_start = eden_start + eden_size; char *from_start = to_start + survivor_size; char *from_end = from_start + survivor_size; assert(from_end == virtual_space()->high(), "just checking"); ! assert(is_object_aligned(eden_start), "checking alignment"); ! assert(is_object_aligned(to_start), "checking alignment"); ! assert(is_object_aligned(from_start), "checking alignment"); MemRegion eden_mr((HeapWord*)eden_start, (HeapWord*)to_start); MemRegion to_mr ((HeapWord*)to_start, (HeapWord*)from_start); MemRegion from_mr((HeapWord*)from_start, (HeapWord*)from_end);
*** 292,302 **** assert(min_gen_size() <= orig_size && orig_size <= max_size(), "just checking"); // Adjust new generation size const size_t eden_plus_survivors = ! align_size_up(eden_size + 2 * survivor_size, alignment); size_t desired_size = MAX2(MIN2(eden_plus_survivors, max_size()), min_gen_size()); assert(desired_size <= max_size(), "just checking"); if (desired_size > orig_size) { --- 292,302 ---- assert(min_gen_size() <= orig_size && orig_size <= max_size(), "just checking"); // Adjust new generation size const size_t eden_plus_survivors = ! align_up(eden_size + 2 * survivor_size, alignment); size_t desired_size = MAX2(MIN2(eden_plus_survivors, max_size()), min_gen_size()); assert(desired_size <= max_size(), "just checking"); if (desired_size > orig_size) {
*** 526,536 **** // Should we be in this method if from_space is empty? Why not the set_space method? FIX ME! if (from_size == 0) { from_size = alignment; } else { ! from_size = align_size_up(from_size, alignment); } from_end = from_start + from_size; assert(from_end > from_start, "addition overflow or from_size problem"); --- 526,536 ---- // Should we be in this method if from_space is empty? Why not the set_space method? FIX ME! if (from_size == 0) { from_size = alignment; } else { ! from_size = align_up(from_size, alignment); } from_end = from_start + from_size; assert(from_end > from_start, "addition overflow or from_size problem");
*** 609,621 **** guarantee((HeapWord*)from_start <= from_space()->bottom(), "from start moved to the right"); guarantee((HeapWord*)from_end >= from_space()->top(), "from end moved into live data"); ! assert(is_ptr_object_aligned(eden_start), "checking alignment"); ! assert(is_ptr_object_aligned(from_start), "checking alignment"); ! assert(is_ptr_object_aligned(to_start), "checking alignment"); MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)eden_end); MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end); MemRegion fromMR((HeapWord*)from_start, (HeapWord*)from_end); --- 609,621 ---- guarantee((HeapWord*)from_start <= from_space()->bottom(), "from start moved to the right"); guarantee((HeapWord*)from_end >= from_space()->top(), "from end moved into live data"); ! assert(is_object_aligned(eden_start), "checking alignment"); ! assert(is_object_aligned(from_start), "checking alignment"); ! assert(is_object_aligned(to_start), "checking alignment"); MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)eden_end); MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end); MemRegion fromMR((HeapWord*)from_start, (HeapWord*)from_end);
*** 813,823 **** space_shrinking->top(), sizeof(char)); } size_t delta_in_bytes = unused_committed + delta_in_survivor; ! delta_in_bytes = align_size_down(delta_in_bytes, gen_alignment); return delta_in_bytes; } // Return the number of bytes available for resizing down the young // generation. This is the minimum of --- 813,823 ---- space_shrinking->top(), sizeof(char)); } size_t delta_in_bytes = unused_committed + delta_in_survivor; ! delta_in_bytes = align_down(delta_in_bytes, gen_alignment); return delta_in_bytes; } // Return the number of bytes available for resizing down the young // generation. This is the minimum of
*** 826,836 **** // bytes to the size currently being used + some small extra size_t PSYoungGen::limit_gen_shrink(size_t bytes) { // Allow shrinkage into the current eden but keep eden large enough // to maintain the minimum young gen size bytes = MIN3(bytes, available_to_min_gen(), available_to_live()); ! return align_size_down(bytes, virtual_space()->alignment()); } void PSYoungGen::reset_after_change() { ShouldNotReachHere(); } --- 826,836 ---- // bytes to the size currently being used + some small extra size_t PSYoungGen::limit_gen_shrink(size_t bytes) { // Allow shrinkage into the current eden but keep eden large enough // to maintain the minimum young gen size bytes = MIN3(bytes, available_to_min_gen(), available_to_live()); ! return align_down(bytes, virtual_space()->alignment()); } void PSYoungGen::reset_after_change() { ShouldNotReachHere(); }
< prev index next >