diff options
Diffstat (limited to 'src/share/vm/services/management.cpp')
-rw-r--r-- | src/share/vm/services/management.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/share/vm/services/management.cpp b/src/share/vm/services/management.cpp index 2775781eb..a8e6b0b27 100644 --- a/src/share/vm/services/management.cpp +++ b/src/share/vm/services/management.cpp @@ -155,11 +155,14 @@ void Management::initialize(TRAPS) { // Load and initialize the sun.management.Agent class // invoke startAgent method to start the management server Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); - Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), + Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_management_Agent(), loader, Handle(), - true, - CHECK); + THREAD); + if (k == NULL) { + vm_exit_during_initialization("Management agent initialization failure: " + "class sun.management.Agent not found."); + } instanceKlassHandle ik (THREAD, k); JavaValue result(T_VOID); @@ -1104,6 +1107,8 @@ static void do_thread_dump(ThreadDumpResult* dump_result, bool with_locked_monitors, bool with_locked_synchronizers, TRAPS) { + // no need to actually perform thread dump if no TIDs are specified + if (num_threads == 0) return; // First get an array of threadObj handles. // A JavaThread may terminate before we get the stack trace. |