diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 51d79037959..1ccdef11efd 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -3048,6 +3048,11 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) { // class metadata instead of modifying them in place. The copy is inaccessible to the compiler. // TODO: revisit the following for the static archive case. set_mode_flags(_int); + + // String deduplication may cause CDS to iterate the strings in different order from one + // run to another which resulting in non-determinstic CDS archives. + // Disable UseStringDeduplication while dumping CDS archive. + UseStringDeduplication = false; } // RecordDynamicDumpInfo is not compatible with ArchiveClassesAtExit diff --git a/test/hotspot/jtreg/runtime/cds/DeterministicDump.java b/test/hotspot/jtreg/runtime/cds/DeterministicDump.java index 9f350bc91d7..9d7e392e8a0 100644 --- a/test/hotspot/jtreg/runtime/cds/DeterministicDump.java +++ b/test/hotspot/jtreg/runtime/cds/DeterministicDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,11 +54,6 @@ public class DeterministicDump { baseArgs.add("-Xmx128M"); if (Platform.is64bit()) { - if (!compressed) { - System.out.println("CDS archives with uncompressed oops are still non-deterministic"); - System.out.println("See https://bugs.openjdk.org/browse/JDK-8282828"); - return; - } // These options are available only on 64-bit. String sign = (compressed) ? "+" : "-"; baseArgs.add("-XX:" + sign + "UseCompressedOops");