Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/collectorPolicy.cpp @ 12238:9e11762cee52
8024650: Don't adjust MaxMetaspaceSize up to MetaspaceSize
Reviewed-by: jwilhelm, brutisso, tschatzl
author | stefank |
---|---|
date | Fri, 13 Sep 2013 22:22:14 +0200 |
parents | 40136aa2cdb1 |
children | 9ecd6d3782b1 |
comparison
equal
deleted
inserted
replaced
12237:335b388c4b28 | 12238:9e11762cee52 |
---|---|
45 #include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" | 45 #include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" |
46 #endif // INCLUDE_ALL_GCS | 46 #endif // INCLUDE_ALL_GCS |
47 | 47 |
48 // CollectorPolicy methods. | 48 // CollectorPolicy methods. |
49 | 49 |
50 // Align down. If the aligning result in 0, return 'alignment'. | |
51 static size_t restricted_align_down(size_t size, size_t alignment) { | |
52 return MAX2(alignment, align_size_down_(size, alignment)); | |
53 } | |
54 | |
50 void CollectorPolicy::initialize_flags() { | 55 void CollectorPolicy::initialize_flags() { |
51 assert(max_alignment() >= min_alignment(), | 56 assert(max_alignment() >= min_alignment(), |
52 err_msg("max_alignment: " SIZE_FORMAT " less than min_alignment: " SIZE_FORMAT, | 57 err_msg("max_alignment: " SIZE_FORMAT " less than min_alignment: " SIZE_FORMAT, |
53 max_alignment(), min_alignment())); | 58 max_alignment(), min_alignment())); |
54 assert(max_alignment() % min_alignment() == 0, | 59 assert(max_alignment() % min_alignment() == 0, |
57 | 62 |
58 if (MaxHeapSize < InitialHeapSize) { | 63 if (MaxHeapSize < InitialHeapSize) { |
59 vm_exit_during_initialization("Incompatible initial and maximum heap sizes specified"); | 64 vm_exit_during_initialization("Incompatible initial and maximum heap sizes specified"); |
60 } | 65 } |
61 | 66 |
67 if (!is_size_aligned(MaxMetaspaceSize, max_alignment())) { | |
68 FLAG_SET_ERGO(uintx, MaxMetaspaceSize, | |
69 restricted_align_down(MaxMetaspaceSize, max_alignment())); | |
70 } | |
71 | |
62 if (MetaspaceSize > MaxMetaspaceSize) { | 72 if (MetaspaceSize > MaxMetaspaceSize) { |
63 MaxMetaspaceSize = MetaspaceSize; | 73 FLAG_SET_ERGO(uintx, MetaspaceSize, MaxMetaspaceSize); |
64 } | 74 } |
65 MetaspaceSize = MAX2(min_alignment(), align_size_down_(MetaspaceSize, min_alignment())); | 75 |
66 // Don't increase Metaspace size limit above specified. | 76 if (!is_size_aligned(MetaspaceSize, min_alignment())) { |
67 MaxMetaspaceSize = align_size_down(MaxMetaspaceSize, max_alignment()); | 77 FLAG_SET_ERGO(uintx, MetaspaceSize, |
68 if (MetaspaceSize > MaxMetaspaceSize) { | 78 restricted_align_down(MetaspaceSize, min_alignment())); |
69 MetaspaceSize = MaxMetaspaceSize; | 79 } |
70 } | 80 |
71 | 81 assert(MetaspaceSize <= MaxMetaspaceSize, "Must be"); |
72 MinMetaspaceExpansion = MAX2(min_alignment(), align_size_down_(MinMetaspaceExpansion, min_alignment())); | 82 |
73 MaxMetaspaceExpansion = MAX2(min_alignment(), align_size_down_(MaxMetaspaceExpansion, min_alignment())); | 83 MinMetaspaceExpansion = restricted_align_down(MinMetaspaceExpansion, min_alignment()); |
84 MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, min_alignment()); | |
74 | 85 |
75 MinHeapDeltaBytes = align_size_up(MinHeapDeltaBytes, min_alignment()); | 86 MinHeapDeltaBytes = align_size_up(MinHeapDeltaBytes, min_alignment()); |
76 | 87 |
77 assert(MetaspaceSize % min_alignment() == 0, "metapace alignment"); | 88 assert(MetaspaceSize % min_alignment() == 0, "metapace alignment"); |
78 assert(MaxMetaspaceSize % max_alignment() == 0, "maximum metaspace alignment"); | 89 assert(MaxMetaspaceSize % max_alignment() == 0, "maximum metaspace alignment"); |