Mercurial > hg > truffle
comparison src/share/vm/memory/collectorPolicy.cpp @ 12873:4e7f99b70d9d
Merge
author | adlertz |
---|---|
date | Wed, 09 Oct 2013 05:03:34 -0700 |
parents | ab68fc0101ce |
children | 9b4d0569f2f4 |
comparison
equal
deleted
inserted
replaced
12872:98692a2d36d7 | 12873:4e7f99b70d9d |
---|---|
62 | 62 |
63 if (MaxHeapSize < InitialHeapSize) { | 63 if (MaxHeapSize < InitialHeapSize) { |
64 vm_exit_during_initialization("Incompatible initial and maximum heap sizes specified"); | 64 vm_exit_during_initialization("Incompatible initial and maximum heap sizes specified"); |
65 } | 65 } |
66 | 66 |
67 if (!is_size_aligned(MaxMetaspaceSize, max_alignment())) { | 67 // Do not use FLAG_SET_ERGO to update MaxMetaspaceSize, since this will |
68 FLAG_SET_ERGO(uintx, MaxMetaspaceSize, | 68 // override if MaxMetaspaceSize was set on the command line or not. |
69 restricted_align_down(MaxMetaspaceSize, max_alignment())); | 69 // This information is needed later to conform to the specification of the |
70 } | 70 // java.lang.management.MemoryUsage API. |
71 // | |
72 // Ideally, we would be able to set the default value of MaxMetaspaceSize in | |
73 // globals.hpp to the aligned value, but this is not possible, since the | |
74 // alignment depends on other flags being parsed. | |
75 MaxMetaspaceSize = restricted_align_down(MaxMetaspaceSize, max_alignment()); | |
71 | 76 |
72 if (MetaspaceSize > MaxMetaspaceSize) { | 77 if (MetaspaceSize > MaxMetaspaceSize) { |
73 FLAG_SET_ERGO(uintx, MetaspaceSize, MaxMetaspaceSize); | 78 MetaspaceSize = MaxMetaspaceSize; |
74 } | 79 } |
75 | 80 |
76 if (!is_size_aligned(MetaspaceSize, min_alignment())) { | 81 MetaspaceSize = restricted_align_down(MetaspaceSize, min_alignment()); |
77 FLAG_SET_ERGO(uintx, MetaspaceSize, | |
78 restricted_align_down(MetaspaceSize, min_alignment())); | |
79 } | |
80 | 82 |
81 assert(MetaspaceSize <= MaxMetaspaceSize, "Must be"); | 83 assert(MetaspaceSize <= MaxMetaspaceSize, "Must be"); |
82 | 84 |
83 MinMetaspaceExpansion = restricted_align_down(MinMetaspaceExpansion, min_alignment()); | 85 MinMetaspaceExpansion = restricted_align_down(MinMetaspaceExpansion, min_alignment()); |
84 MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, min_alignment()); | 86 MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, min_alignment()); |
133 return result; | 135 return result; |
134 } | 136 } |
135 | 137 |
136 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, | 138 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, |
137 int max_covered_regions) { | 139 int max_covered_regions) { |
138 switch (rem_set_name()) { | 140 assert(rem_set_name() == GenRemSet::CardTable, "unrecognized GenRemSet::Name"); |
139 case GenRemSet::CardTable: { | 141 return new CardTableRS(whole_heap, max_covered_regions); |
140 CardTableRS* res = new CardTableRS(whole_heap, max_covered_regions); | |
141 return res; | |
142 } | |
143 default: | |
144 guarantee(false, "unrecognized GenRemSet::Name"); | |
145 return NULL; | |
146 } | |
147 } | 142 } |
148 | 143 |
149 void CollectorPolicy::cleared_all_soft_refs() { | 144 void CollectorPolicy::cleared_all_soft_refs() { |
150 // If near gc overhear limit, continue to clear SoftRefs. SoftRefs may | 145 // If near gc overhear limit, continue to clear SoftRefs. SoftRefs may |
151 // have been cleared in the last collection but if the gc overhear | 146 // have been cleared in the last collection but if the gc overhear |