Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/collectorPolicy.cpp @ 12346:9ecd6d3782b1
8025313: MetaspaceMemoryPool incorrectly reports undefined size for max
Reviewed-by: stefank, tschatzl
author | ehelin |
---|---|
date | Tue, 01 Oct 2013 15:21:14 +0200 |
parents | 9e11762cee52 |
children | ab68fc0101ce |
comparison
equal
deleted
inserted
replaced
12345:9de9169ddde6 | 12346:9ecd6d3782b1 |
---|---|
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()); |