diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp index 637f8f862d7..4248313ad02 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp @@ -66,10 +66,10 @@ class StringDedupSharedClosure: public OopClosure { } }; -// The CDS archive does not include the string dedupication table. Only the string +// The CDS archive does not include the string deduplication table. Only the string // table is saved in the archive. The shared strings from CDS archive need to be -// added to the string dedupication table before deduplication occurs. That is -// done in the begining of the StringDedupThread (see StringDedupThread::do_deduplication()). +// added to the string deduplication table before deduplication occurs. That is +// done in the beginning of the StringDedupThread (see StringDedupThread::do_deduplication()). void StringDedupThread::deduplicate_shared_strings(StringDedupStat* stat) { StringDedupSharedClosure sharedStringDedup(stat); StringTable::shared_oops_do(&sharedStringDedup); diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp index ee705334c6a..05d92e66eec 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp @@ -33,7 +33,11 @@ template void StringDedupThreadImpl::do_deduplication() { S total_stat; - deduplicate_shared_strings(&total_stat); + { + // Block safepoints while deduplicating shared strings + SuspendibleThreadSetJoiner sts_join; + deduplicate_shared_strings(&total_stat); + } // Main loop for (;;) {