Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/arguments.cpp @ 135:b7268662a986
6689523: max heap calculation for compressed oops is off by MaxPermSize
Summary: Need to subtract MaxPermSize from the total heap size when determining whether compressed oops is turned on.
Reviewed-by: jmasa, jcoomes, kvn
author | coleenp |
---|---|
date | Tue, 29 Apr 2008 19:31:29 -0400 |
parents | ba764ed4b6f2 |
children | 9148c65abefc 37f87013dfd8 |
comparison
equal
deleted
inserted
replaced
134:8a79f7ec8f5d | 135:b7268662a986 |
---|---|
1123 "for the CMS collector. CMSParPromoteBlocksToClaim will take precedence.\n"); | 1123 "for the CMS collector. CMSParPromoteBlocksToClaim will take precedence.\n"); |
1124 } | 1124 } |
1125 } | 1125 } |
1126 } | 1126 } |
1127 | 1127 |
1128 inline uintx max_heap_for_compressed_oops() { | |
1129 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); | |
1130 NOT_LP64(return DefaultMaxRAM); | |
1131 } | |
1132 | |
1128 bool Arguments::should_auto_select_low_pause_collector() { | 1133 bool Arguments::should_auto_select_low_pause_collector() { |
1129 if (UseAutoGCSelectPolicy && | 1134 if (UseAutoGCSelectPolicy && |
1130 !FLAG_IS_DEFAULT(MaxGCPauseMillis) && | 1135 !FLAG_IS_DEFAULT(MaxGCPauseMillis) && |
1131 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { | 1136 (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { |
1132 if (PrintGCDetails) { | 1137 if (PrintGCDetails) { |
1167 #ifdef _LP64 | 1172 #ifdef _LP64 |
1168 // Compressed Headers do not work with CMS, which uses a bit in the klass | 1173 // Compressed Headers do not work with CMS, which uses a bit in the klass |
1169 // field offset to determine free list chunk markers. | 1174 // field offset to determine free list chunk markers. |
1170 // Check that UseCompressedOops can be set with the max heap size allocated | 1175 // Check that UseCompressedOops can be set with the max heap size allocated |
1171 // by ergonomics. | 1176 // by ergonomics. |
1172 if (!UseConcMarkSweepGC && MaxHeapSize <= (32*G - os::vm_page_size())) { | 1177 if (!UseConcMarkSweepGC && MaxHeapSize <= max_heap_for_compressed_oops()) { |
1173 if (FLAG_IS_DEFAULT(UseCompressedOops)) { | 1178 if (FLAG_IS_DEFAULT(UseCompressedOops)) { |
1174 FLAG_SET_ERGO(bool, UseCompressedOops, true); | 1179 FLAG_SET_ERGO(bool, UseCompressedOops, true); |
1175 } | 1180 } |
1176 } else { | 1181 } else { |
1177 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { | 1182 if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { |
1203 Abstract_VM_Version::parallel_worker_threads()); | 1208 Abstract_VM_Version::parallel_worker_threads()); |
1204 | 1209 |
1205 if (FLAG_IS_DEFAULT(MaxHeapSize)) { | 1210 if (FLAG_IS_DEFAULT(MaxHeapSize)) { |
1206 const uint64_t reasonable_fraction = | 1211 const uint64_t reasonable_fraction = |
1207 os::physical_memory() / DefaultMaxRAMFraction; | 1212 os::physical_memory() / DefaultMaxRAMFraction; |
1208 const uint64_t maximum_size = (uint64_t) DefaultMaxRAM; | 1213 const uint64_t maximum_size = (uint64_t) |
1214 (FLAG_IS_DEFAULT(DefaultMaxRAM) && UseCompressedOops ? | |
1215 MIN2(max_heap_for_compressed_oops(), DefaultMaxRAM) : | |
1216 DefaultMaxRAM); | |
1209 size_t reasonable_max = | 1217 size_t reasonable_max = |
1210 (size_t) os::allocatable_physical_memory(reasonable_fraction); | 1218 (size_t) os::allocatable_physical_memory(reasonable_fraction); |
1211 if (reasonable_max > maximum_size) { | 1219 if (reasonable_max > maximum_size) { |
1212 reasonable_max = maximum_size; | 1220 reasonable_max = maximum_size; |
1213 } | 1221 } |