SUGGESTED FIX
diff --git a/src/share/vm/runtime/java.cpp b/src/share/vm/runtime/java.cpp
--- a/src/share/vm/runtime/java.cpp
+++ b/src/share/vm/runtime/java.cpp
@@ -468,12 +468,9 @@
StatSampler::disengage();
StatSampler::destroy();
-#ifndef SERIALGC
- // stop CMS threads
- if (UseConcMarkSweepGC) {
- ConcurrentMarkSweepThread::stop();
- }
-#endif // SERIALGC
+ // We do not need to explicitly stop concurrent GC threads because the
+ // JVM will be taken down at a safepoint when such threads are inactive;
+ // see destroy_vm().
// Print GC/heap related information.
if (PrintGCDetails) {
diff --git a/src/share/vm/runtime/thread.cpp b/src/share/vm/runtime/thread.cpp
--- a/src/share/vm/runtime/thread.cpp
+++ b/src/share/vm/runtime/thread.cpp
@@ -3698,6 +3698,9 @@
// heap is unparseable if they are caught. Grab the Heap_lock
// to prevent this. The GC vm_operations will not be able to
// queue until after the vm thread is dead.
+ // After this point, we'll never emerge out of the safepoint before
+ // the VM exits, so concurrent GC threads do not need to be explicitly
+ // stopped; they remain inactive until the process exits.
MutexLocker ml(Heap_lock);
VMThread::wait_for_vm_thread_exit();
|