< prev index next >

src/share/vm/services/diagnosticCommand.cpp

Print this page




 252     output()->date_stamp(true, "", ": ");
 253   }
 254   output()->time_stamp().update_to(tty->time_stamp().ticks());
 255   output()->stamp();
 256   output()->print_cr(" s");
 257 }
 258 
 259 int VMUptimeDCmd::num_arguments() {
 260   ResourceMark rm;
 261   VMUptimeDCmd* dcmd = new VMUptimeDCmd(NULL, false);
 262   if (dcmd != NULL) {
 263     DCmdMark mark(dcmd);
 264     return dcmd->_dcmdparser.num_arguments();
 265   } else {
 266     return 0;
 267   }
 268 }
 269 
 270 void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
 271   if (!DisableExplicitGC) {
 272     Universe::heap()->collect(GCCause::_java_lang_system_gc);
 273   } else {
 274     output()->print_cr("Explicit GC is disabled, no GC has been performed.");
 275   }
 276 }
 277 
 278 void RunFinalizationDCmd::execute(DCmdSource source, TRAPS) {
 279   Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(),
 280                                                  true, CHECK);
 281   instanceKlassHandle klass(THREAD, k);
 282   JavaValue result(T_VOID);
 283   JavaCalls::call_static(&result, klass,
 284                          vmSymbols::run_finalization_name(),
 285                          vmSymbols::void_method_signature(), CHECK);
 286 }
 287 
 288 #if INCLUDE_SERVICES // Heap dumping/inspection supported
 289 HeapDumpDCmd::HeapDumpDCmd(outputStream* output, bool heap) :
 290                            DCmdWithParser(output, heap),
 291   _filename("filename","Name of the dump file", "STRING",true),
 292   _all("-all", "Dump all objects, including unreachable objects",




 252     output()->date_stamp(true, "", ": ");
 253   }
 254   output()->time_stamp().update_to(tty->time_stamp().ticks());
 255   output()->stamp();
 256   output()->print_cr(" s");
 257 }
 258 
 259 int VMUptimeDCmd::num_arguments() {
 260   ResourceMark rm;
 261   VMUptimeDCmd* dcmd = new VMUptimeDCmd(NULL, false);
 262   if (dcmd != NULL) {
 263     DCmdMark mark(dcmd);
 264     return dcmd->_dcmdparser.num_arguments();
 265   } else {
 266     return 0;
 267   }
 268 }
 269 
 270 void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
 271   if (!DisableExplicitGC) {
 272     Universe::heap()->collect(GCCause::_dcmd_gc_run);
 273   } else {
 274     output()->print_cr("Explicit GC is disabled, no GC has been performed.");
 275   }
 276 }
 277 
 278 void RunFinalizationDCmd::execute(DCmdSource source, TRAPS) {
 279   Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(),
 280                                                  true, CHECK);
 281   instanceKlassHandle klass(THREAD, k);
 282   JavaValue result(T_VOID);
 283   JavaCalls::call_static(&result, klass,
 284                          vmSymbols::run_finalization_name(),
 285                          vmSymbols::void_method_signature(), CHECK);
 286 }
 287 
 288 #if INCLUDE_SERVICES // Heap dumping/inspection supported
 289 HeapDumpDCmd::HeapDumpDCmd(outputStream* output, bool heap) :
 290                            DCmdWithParser(output, heap),
 291   _filename("filename","Name of the dump file", "STRING",true),
 292   _all("-all", "Dump all objects, including unreachable objects",


< prev index next >