src/share/vm/services/gcNotifier.cpp

Print this page




 164   constructor_args.push_oop(getGcInfoBuilder(gcManager,THREAD));
 165   constructor_args.push_long(gcStatInfo->gc_index());
 166   constructor_args.push_long(gcStatInfo->start_time());
 167   constructor_args.push_long(gcStatInfo->end_time());
 168   constructor_args.push_oop(usage_before_gc_ah);
 169   constructor_args.push_oop(usage_after_gc_ah);
 170   constructor_args.push_oop(extra_array);
 171 
 172   JavaCalls::call_special(&constructor_result,
 173                           ik,
 174                           vmSymbols::object_initializer_name(),
 175                           vmSymbols::com_sun_management_GcInfo_constructor_signature(),
 176                           &constructor_args,
 177                           CHECK_NH);
 178 
 179   return Handle(gcInfo_instance());
 180 }
 181 
 182 void GCNotifier::sendNotification(TRAPS) {
 183   ResourceMark rm(THREAD);

 184   GCNotificationRequest *request = getRequest();
 185   if(request != NULL) {
 186     Handle objGcInfo = createGcInfo(request->gcManager,request->gcStatInfo,THREAD);
 187 
 188     Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK);
 189     Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK);
 190     Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK);
 191 
 192     klassOop k = Management::sun_management_GarbageCollectorImpl_klass(CHECK);
 193     instanceKlassHandle gc_mbean_klass (THREAD, k);
 194 
 195     instanceOop gc_mbean = request->gcManager->get_memory_manager_instance(THREAD);
 196     instanceHandle gc_mbean_h(THREAD, gc_mbean);
 197     if (!gc_mbean_h->is_a(k)) {
 198       THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
 199                 "This GCMemoryManager doesn't have a GarbageCollectorMXBean");
 200     }
 201 
 202     JavaValue result(T_VOID);
 203     JavaCallArguments args(gc_mbean_h);


 164   constructor_args.push_oop(getGcInfoBuilder(gcManager,THREAD));
 165   constructor_args.push_long(gcStatInfo->gc_index());
 166   constructor_args.push_long(gcStatInfo->start_time());
 167   constructor_args.push_long(gcStatInfo->end_time());
 168   constructor_args.push_oop(usage_before_gc_ah);
 169   constructor_args.push_oop(usage_after_gc_ah);
 170   constructor_args.push_oop(extra_array);
 171 
 172   JavaCalls::call_special(&constructor_result,
 173                           ik,
 174                           vmSymbols::object_initializer_name(),
 175                           vmSymbols::com_sun_management_GcInfo_constructor_signature(),
 176                           &constructor_args,
 177                           CHECK_NH);
 178 
 179   return Handle(gcInfo_instance());
 180 }
 181 
 182 void GCNotifier::sendNotification(TRAPS) {
 183   ResourceMark rm(THREAD);
 184   HandleMark hm(THREAD);
 185   GCNotificationRequest *request = getRequest();
 186   if(request != NULL) {
 187     Handle objGcInfo = createGcInfo(request->gcManager,request->gcStatInfo,THREAD);
 188 
 189     Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK);
 190     Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK);
 191     Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK);
 192 
 193     klassOop k = Management::sun_management_GarbageCollectorImpl_klass(CHECK);
 194     instanceKlassHandle gc_mbean_klass (THREAD, k);
 195 
 196     instanceOop gc_mbean = request->gcManager->get_memory_manager_instance(THREAD);
 197     instanceHandle gc_mbean_h(THREAD, gc_mbean);
 198     if (!gc_mbean_h->is_a(k)) {
 199       THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
 200                 "This GCMemoryManager doesn't have a GarbageCollectorMXBean");
 201     }
 202 
 203     JavaValue result(T_VOID);
 204     JavaCallArguments args(gc_mbean_h);