--- old/src/hotspot/share/gc/z/zArguments.cpp 2018-06-26 18:41:38.884106841 -0400 +++ new/src/hotspot/share/gc/z/zArguments.cpp 2018-06-26 18:41:38.668106849 -0400 @@ -82,6 +82,11 @@ // CompressedOops/UseCompressedClassPointers not supported FLAG_SET_DEFAULT(UseCompressedOops, false); FLAG_SET_DEFAULT(UseCompressedClassPointers, false); + FLAG_SET_DEFAULT(UseSharedSpaces, false); // requires CompressedOops and CompressedClassPointers + + if (DumpSharedSpaces) { + vm_exit_during_initialization("DumpSharedSpaces (-Xshare:dump) is not supported with ZGC."); + } // ClassUnloading not (yet) supported FLAG_SET_DEFAULT(ClassUnloading, false); --- old/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java 2018-06-26 18:41:39.192106830 -0400 +++ new/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java 2018-06-26 18:41:38.984106838 -0400 @@ -24,6 +24,7 @@ /** * @test * @bug 8014138 + * @bug 8205702 * @summary Testing new -XX:SharedArchiveFile= option * @requires vm.cds * @library /test/lib @@ -52,5 +53,14 @@ "-Xshare:on", "-version"); out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile"); CDSTestUtils.checkExec(out); + + // CDS dumping doesn't work with ZGC + pb = ProcessTools.createJavaProcessBuilder(true, + "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", + "-XX:+UnlockExperimentalVMOptions", + "-XX:+UseZGC", + "-Xshare:dump"); + out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile"); + CDSTestUtils.checkExecExpectError(out, 1, "DumpSharedSpaces (-Xshare:dump) is not supported with ZGC."); } }