--- old/src/share/vm/services/memoryService.cpp 2015-11-19 15:35:30.402128456 +0100 +++ new/src/share/vm/services/memoryService.cpp 2015-11-19 15:35:30.278128460 +0100 @@ -32,6 +32,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/generationSpec.hpp" +#include "logging/logConfiguration.hpp" #include "memory/heap.hpp" #include "memory/memRegion.hpp" #include "oops/oop.inline.hpp" @@ -517,8 +518,11 @@ bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - Flag::Error error = CommandLineFlags::boolAtPut("PrintGC", &verbose, Flag::MANAGEMENT); - assert(error==Flag::SUCCESS, "Setting PrintGC flag failed with error %s", Flag::flag_error_str(error)); + if (verbose) { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } ClassLoadingService::reset_trace_class_unloading(); return verbose;