diff -r 57552dca1708 -r 924777755fad src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Mon Mar 21 14:06:50 2011 -0700 +++ b/src/share/vm/runtime/arguments.cpp Mon Mar 21 18:38:00 2011 -0700 @@ -2819,22 +2819,38 @@ } void Arguments::set_shared_spaces_flags() { + const bool must_share = DumpSharedSpaces || RequireSharedSpaces; + const bool might_share = must_share || UseSharedSpaces; + + // The string table is part of the shared archive so the size must match. + if (!FLAG_IS_DEFAULT(StringTableSize)) { + // Disable sharing. + if (must_share) { + warning("disabling shared archive %s because of non-default " + "StringTableSize", DumpSharedSpaces ? "creation" : "use"); + } + if (might_share) { + FLAG_SET_DEFAULT(DumpSharedSpaces, false); + FLAG_SET_DEFAULT(RequireSharedSpaces, false); + FLAG_SET_DEFAULT(UseSharedSpaces, false); + } + return; + } + // Check whether class data sharing settings conflict with GC, compressed oops // or page size, and fix them up. Explicit sharing options override other // settings. const bool cannot_share = UseConcMarkSweepGC || CMSIncrementalMode || UseG1GC || UseParNewGC || UseParallelGC || UseParallelOldGC || UseCompressedOops || UseLargePages && FLAG_IS_CMDLINE(UseLargePages); - const bool must_share = DumpSharedSpaces || RequireSharedSpaces; - const bool might_share = must_share || UseSharedSpaces; if (cannot_share) { if (must_share) { - warning("selecting serial gc and disabling large pages %s" - "because of %s", "" LP64_ONLY("and compressed oops "), - DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); - force_serial_gc(); - FLAG_SET_CMDLINE(bool, UseLargePages, false); - LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false)); + warning("selecting serial gc and disabling large pages %s" + "because of %s", "" LP64_ONLY("and compressed oops "), + DumpSharedSpaces ? "-Xshare:dump" : "-Xshare:on"); + force_serial_gc(); + FLAG_SET_CMDLINE(bool, UseLargePages, false); + LP64_ONLY(FLAG_SET_CMDLINE(bool, UseCompressedOops, false)); } else { if (UseSharedSpaces && Verbose) { warning("turning off use of shared archive because of "