84 // be 512*4096 = 2MB aligned.
85
86 size_t alignment = CardTableRS::ct_max_alignment_constraint();
87
88 if (UseLargePages) {
89 // In presence of large pages we have to make sure that our
90 // alignment is large page aware.
91 alignment = lcm(os::large_page_size(), alignment);
92 }
93
94 return alignment;
95 }
96
97 bool GCArguments::check_args_consistency() {
98 bool status = true;
99 if (!FLAG_IS_DEFAULT(AllocateHeapAt) && !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
100 jio_fprintf(defaultStream::error_stream(),
101 "AllocateHeapAt and AllocateOldGenAt cannot be used together.\n");
102 status = false;
103 }
104 if (!FLAG_IS_DEFAULT(AllocateOldGenAt) && (UseSerialGC || UseEpsilonGC || UseZGC)) {
105 jio_fprintf(defaultStream::error_stream(),
106 "AllocateOldGenAt is not supported for selected GC.\n");
107 status = false;
108 }
109 return status;
110 }
111
112 #ifdef ASSERT
113 void GCArguments::assert_flags() {
114 assert(InitialHeapSize <= MaxHeapSize, "Ergonomics decided on incompatible initial and maximum heap sizes");
115 assert(InitialHeapSize % HeapAlignment == 0, "InitialHeapSize alignment");
116 assert(MaxHeapSize % HeapAlignment == 0, "MaxHeapSize alignment");
117 }
118
119 void GCArguments::assert_size_info() {
120 assert(MaxHeapSize >= MinHeapSize, "Ergonomics decided on incompatible minimum and maximum heap sizes");
121 assert(InitialHeapSize >= MinHeapSize, "Ergonomics decided on incompatible initial and minimum heap sizes");
122 assert(MaxHeapSize >= InitialHeapSize, "Ergonomics decided on incompatible initial and maximum heap sizes");
123 assert(MinHeapSize % HeapAlignment == 0, "MinHeapSize alignment");
|
84 // be 512*4096 = 2MB aligned.
85
86 size_t alignment = CardTableRS::ct_max_alignment_constraint();
87
88 if (UseLargePages) {
89 // In presence of large pages we have to make sure that our
90 // alignment is large page aware.
91 alignment = lcm(os::large_page_size(), alignment);
92 }
93
94 return alignment;
95 }
96
97 bool GCArguments::check_args_consistency() {
98 bool status = true;
99 if (!FLAG_IS_DEFAULT(AllocateHeapAt) && !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
100 jio_fprintf(defaultStream::error_stream(),
101 "AllocateHeapAt and AllocateOldGenAt cannot be used together.\n");
102 status = false;
103 }
104 if (!FLAG_IS_DEFAULT(AllocateHeapAt) && UseLargePages) {
105 jio_fprintf(defaultStream::error_stream(),
106 "AllocateHeapAt and UseLargePages cannot be used together.\n");
107 status = false;
108 }
109 if (!FLAG_IS_DEFAULT(AllocateOldGenAt) && (UseSerialGC || UseEpsilonGC || UseZGC)) {
110 jio_fprintf(defaultStream::error_stream(),
111 "AllocateOldGenAt is not supported for selected GC.\n");
112 status = false;
113 }
114 return status;
115 }
116
117 #ifdef ASSERT
118 void GCArguments::assert_flags() {
119 assert(InitialHeapSize <= MaxHeapSize, "Ergonomics decided on incompatible initial and maximum heap sizes");
120 assert(InitialHeapSize % HeapAlignment == 0, "InitialHeapSize alignment");
121 assert(MaxHeapSize % HeapAlignment == 0, "MaxHeapSize alignment");
122 }
123
124 void GCArguments::assert_size_info() {
125 assert(MaxHeapSize >= MinHeapSize, "Ergonomics decided on incompatible minimum and maximum heap sizes");
126 assert(InitialHeapSize >= MinHeapSize, "Ergonomics decided on incompatible initial and minimum heap sizes");
127 assert(MaxHeapSize >= InitialHeapSize, "Ergonomics decided on incompatible initial and maximum heap sizes");
128 assert(MinHeapSize % HeapAlignment == 0, "MinHeapSize alignment");
|