diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 4ebfea4469d26f7116a560323dff8035a09174b1..14dbcb72e9619fa1fb1ff16f188288f38bb993b1 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1690,7 +1690,7 @@ void check_gclog_consistency() { (NumberOfGCLogFiles == 0) || (GCLogFileSize == 0)) { jio_fprintf(defaultStream::output_stream(), - "To enable GC log rotation, use -Xloggc: -XX:+UseGCLogRotaion -XX:NumberOfGCLogFiles= -XX:GCLogFileSize=\n" + "To enable GC log rotation, use -Xloggc: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles= -XX:GCLogFileSize=\n" "where num_of_file > 0 and num_of_size > 0\n" "GC log rotation is turned off\n"); UseGCLogFileRotation = false; diff --git a/src/share/vm/runtime/java.cpp b/src/share/vm/runtime/java.cpp index c415016f86b7dc82abb01517094859d8e8af912c..73065fe42a89cc82ab711698240b88de87dea6fc 100644 --- a/src/share/vm/runtime/java.cpp +++ b/src/share/vm/runtime/java.cpp @@ -468,12 +468,10 @@ void before_exit(JavaThread * thread) { 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 -- + // except for some concurrent G1 threads, see (comment in) + // Threads::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 index 97b55ead15f0e0f54fee026b44c3c4b9a47942d2..72a3f51f9a9f99e62e3919bccca141f89f416d77 100644 --- a/src/share/vm/runtime/thread.cpp +++ b/src/share/vm/runtime/thread.cpp @@ -3698,6 +3698,14 @@ bool Threads::destroy_vm() { // 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. + // Note: some concurrent G1 threads may be running during a safepoint, + // but these will not be accessing the heap, just some G1-specific side + // data structures that are not accessed by any other threads but them + // after this point in a terminal safepoint. + MutexLocker ml(Heap_lock); VMThread::wait_for_vm_thread_exit();