7196103: NPG: Unable to allocate bit map for parallel garbage collection for the requested heap size

Don't allocate huge class metaspace size by default on x64

Reviewed-by: stefank, jmasa, kvn
This commit is contained in:
Coleen Phillimore 2012-09-07 16:42:25 -04:00
parent 12b9a4edbb
commit 6fda647450
4 changed files with 24 additions and 8 deletions

View file

@ -1427,6 +1427,16 @@ void Arguments::set_ergonomics_flags() {
// if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
// FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
// }
// Set the ClassMetaspaceSize to something that will not need to be
// expanded, since it cannot be expanded.
if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
// 100,000 classes seems like a good size, so 100M assumes around 1K
// per klass. The vtable and oopMap is embedded so we don't have a fixed
// size per klass. Eventually, this will be parameterized because it
// would also be useful to determine the optimal size of the
// systemDictionary.
FLAG_SET_ERGO(uintx, ClassMetaspaceSize, 100*M);
}
}
// Also checks that certain machines are slower with compressed oops
// in vm_version initialization code.
@ -1965,6 +1975,9 @@ bool Arguments::check_vm_args_consistency() {
status = status && verify_object_alignment();
status = status && verify_min_value(ClassMetaspaceSize, 1*M,
"ClassMetaspaceSize");
return status;
}
@ -2916,7 +2929,7 @@ void Arguments::set_shared_spaces_flags() {
(UseLargePages && FLAG_IS_CMDLINE(UseLargePages));
if (cannot_share) {
if (must_share) {
warning("disabling large pages%s"
warning("disabling large pages %s"
"because of %s", "" LP64_ONLY("and compressed oops "),
DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on");
FLAG_SET_CMDLINE(bool, UseLargePages, false);