Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp @ 13060:8f07aa079343
8016309: assert(eden_size > 0 && survivor_size > 0) failed: just checking
7057939: jmap shows MaxNewSize=4GB when Java is using parallel collector
Summary: Major cleanup of the collectorpolicy classes
Reviewed-by: tschatzl, jcoomes
author | jwilhelm |
---|---|
date | Fri, 01 Nov 2013 17:09:38 +0100 |
parents | 46d7652b223c |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
13059:46d7652b223c | 13060:8f07aa079343 |
---|---|
73 size_t current_committed_size = virtual_space()->committed_size(); | 73 size_t current_committed_size = virtual_space()->committed_size(); |
74 assert((gen_size_limit() >= current_committed_size), | 74 assert((gen_size_limit() >= current_committed_size), |
75 "generation size limit is wrong"); | 75 "generation size limit is wrong"); |
76 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 76 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
77 size_t result = gen_size_limit() - current_committed_size; | 77 size_t result = gen_size_limit() - current_committed_size; |
78 size_t result_aligned = align_size_down(result, heap->young_gen_alignment()); | 78 size_t result_aligned = align_size_down(result, heap->generation_alignment()); |
79 return result_aligned; | 79 return result_aligned; |
80 } | 80 } |
81 | 81 |
82 // Return the number of bytes the young gen is willing give up. | 82 // Return the number of bytes the young gen is willing give up. |
83 // | 83 // |
90 } | 90 } |
91 | 91 |
92 if (eden_space()->is_empty()) { | 92 if (eden_space()->is_empty()) { |
93 // Respect the minimum size for eden and for the young gen as a whole. | 93 // Respect the minimum size for eden and for the young gen as a whole. |
94 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 94 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
95 const size_t eden_alignment = heap->intra_heap_alignment(); | 95 const size_t eden_alignment = heap->space_alignment(); |
96 const size_t gen_alignment = heap->young_gen_alignment(); | 96 const size_t gen_alignment = heap->generation_alignment(); |
97 | 97 |
98 assert(eden_space()->capacity_in_bytes() >= eden_alignment, | 98 assert(eden_space()->capacity_in_bytes() >= eden_alignment, |
99 "Alignment is wrong"); | 99 "Alignment is wrong"); |
100 size_t eden_avail = eden_space()->capacity_in_bytes() - eden_alignment; | 100 size_t eden_avail = eden_space()->capacity_in_bytes() - eden_alignment; |
101 eden_avail = align_size_down(eden_avail, gen_alignment); | 101 eden_avail = align_size_down(eden_avail, gen_alignment); |
127 // The current implementation only considers to the end of eden. | 127 // The current implementation only considers to the end of eden. |
128 // If to_space is below from_space, to_space is not considered. | 128 // If to_space is below from_space, to_space is not considered. |
129 // to_space can be. | 129 // to_space can be. |
130 size_t ASPSYoungGen::available_to_live() { | 130 size_t ASPSYoungGen::available_to_live() { |
131 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 131 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
132 const size_t alignment = heap->intra_heap_alignment(); | 132 const size_t alignment = heap->space_alignment(); |
133 | 133 |
134 // Include any space that is committed but is not in eden. | 134 // Include any space that is committed but is not in eden. |
135 size_t available = pointer_delta(eden_space()->bottom(), | 135 size_t available = pointer_delta(eden_space()->bottom(), |
136 virtual_space()->low(), | 136 virtual_space()->low(), |
137 sizeof(char)); | 137 sizeof(char)); |
291 char* to_end = (char*)to_space()->end(); | 291 char* to_end = (char*)to_space()->end(); |
292 | 292 |
293 assert(eden_start < from_start, "Cannot push into from_space"); | 293 assert(eden_start < from_start, "Cannot push into from_space"); |
294 | 294 |
295 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 295 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
296 const size_t alignment = heap->intra_heap_alignment(); | 296 const size_t alignment = heap->space_alignment(); |
297 const bool maintain_minimum = | 297 const bool maintain_minimum = |
298 (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size(); | 298 (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size(); |
299 | 299 |
300 bool eden_from_to_order = from_start < to_start; | 300 bool eden_from_to_order = from_start < to_start; |
301 // Check whether from space is below to space | 301 // Check whether from space is below to space |