Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/parallelScavenge/psYoungGen.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 | 0b54ffe4c2d3 |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
13059:46d7652b223c | 13060:8f07aa079343 |
---|---|
101 // Generation Counters - generation 0, 3 subspaces | 101 // Generation Counters - generation 0, 3 subspaces |
102 _gen_counters = new PSGenerationCounters("new", 0, 3, _virtual_space); | 102 _gen_counters = new PSGenerationCounters("new", 0, 3, _virtual_space); |
103 | 103 |
104 // Compute maximum space sizes for performance counters | 104 // Compute maximum space sizes for performance counters |
105 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 105 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
106 size_t alignment = heap->intra_heap_alignment(); | 106 size_t alignment = heap->space_alignment(); |
107 size_t size = virtual_space()->reserved_size(); | 107 size_t size = virtual_space()->reserved_size(); |
108 | 108 |
109 size_t max_survivor_size; | 109 size_t max_survivor_size; |
110 size_t max_eden_size; | 110 size_t max_eden_size; |
111 | 111 |
154 void PSYoungGen::compute_initial_space_boundaries() { | 154 void PSYoungGen::compute_initial_space_boundaries() { |
155 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 155 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
156 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); | 156 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
157 | 157 |
158 // Compute sizes | 158 // Compute sizes |
159 size_t alignment = heap->intra_heap_alignment(); | 159 size_t alignment = heap->space_alignment(); |
160 size_t size = virtual_space()->committed_size(); | 160 size_t size = virtual_space()->committed_size(); |
161 assert(size >= 3 * alignment, "Young space is not large enough for eden + 2 survivors"); | |
161 | 162 |
162 size_t survivor_size = size / InitialSurvivorRatio; | 163 size_t survivor_size = size / InitialSurvivorRatio; |
163 survivor_size = align_size_down(survivor_size, alignment); | 164 survivor_size = align_size_down(survivor_size, alignment); |
164 // ... but never less than an alignment | 165 // ... but never less than an alignment |
165 survivor_size = MAX2(survivor_size, alignment); | 166 survivor_size = MAX2(survivor_size, alignment); |
205 } | 206 } |
206 | 207 |
207 #ifndef PRODUCT | 208 #ifndef PRODUCT |
208 void PSYoungGen::space_invariants() { | 209 void PSYoungGen::space_invariants() { |
209 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 210 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
210 const size_t alignment = heap->intra_heap_alignment(); | 211 const size_t alignment = heap->space_alignment(); |
211 | 212 |
212 // Currently, our eden size cannot shrink to zero | 213 // Currently, our eden size cannot shrink to zero |
213 guarantee(eden_space()->capacity_in_bytes() >= alignment, "eden too small"); | 214 guarantee(eden_space()->capacity_in_bytes() >= alignment, "eden too small"); |
214 guarantee(from_space()->capacity_in_bytes() >= alignment, "from too small"); | 215 guarantee(from_space()->capacity_in_bytes() >= alignment, "from too small"); |
215 guarantee(to_space()->capacity_in_bytes() >= alignment, "to too small"); | 216 guarantee(to_space()->capacity_in_bytes() >= alignment, "to too small"); |
489 char* from_end = (char*)from_space()->end(); | 490 char* from_end = (char*)from_space()->end(); |
490 char* to_start = (char*)to_space()->bottom(); | 491 char* to_start = (char*)to_space()->bottom(); |
491 char* to_end = (char*)to_space()->end(); | 492 char* to_end = (char*)to_space()->end(); |
492 | 493 |
493 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 494 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
494 const size_t alignment = heap->intra_heap_alignment(); | 495 const size_t alignment = heap->space_alignment(); |
495 const bool maintain_minimum = | 496 const bool maintain_minimum = |
496 (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size(); | 497 (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size(); |
497 | 498 |
498 bool eden_from_to_order = from_start < to_start; | 499 bool eden_from_to_order = from_start < to_start; |
499 // Check whether from space is below to space | 500 // Check whether from space is below to space |
838 // any shrinkage of the young gen is limited by location of | 839 // any shrinkage of the young gen is limited by location of |
839 // from-space. | 840 // from-space. |
840 size_t PSYoungGen::available_to_live() { | 841 size_t PSYoungGen::available_to_live() { |
841 size_t delta_in_survivor = 0; | 842 size_t delta_in_survivor = 0; |
842 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 843 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
843 const size_t space_alignment = heap->intra_heap_alignment(); | 844 const size_t space_alignment = heap->space_alignment(); |
844 const size_t gen_alignment = heap->young_gen_alignment(); | 845 const size_t gen_alignment = heap->generation_alignment(); |
845 | 846 |
846 MutableSpace* space_shrinking = NULL; | 847 MutableSpace* space_shrinking = NULL; |
847 if (from_space()->end() > to_space()->end()) { | 848 if (from_space()->end() > to_space()->end()) { |
848 space_shrinking = from_space(); | 849 space_shrinking = from_space(); |
849 } else { | 850 } else { |