src/hotspot/share/services/attachListener.cpp
changeset 59006 d3f1cb09b704
parent 57876 30db6422848b
equal deleted inserted replaced
59005:01d47d511f5f 59006:d3f1cb09b704
   235 
   235 
   236     // Request a full GC before heap dump if live_objects_only = true
   236     // Request a full GC before heap dump if live_objects_only = true
   237     // This helps reduces the amount of unreachable objects in the dump
   237     // This helps reduces the amount of unreachable objects in the dump
   238     // and makes it easier to browse.
   238     // and makes it easier to browse.
   239     HeapDumper dumper(live_objects_only /* request GC */);
   239     HeapDumper dumper(live_objects_only /* request GC */);
   240     int res = dumper.dump(op->arg(0));
   240     dumper.dump(op->arg(0), out);
   241     if (res == 0) {
       
   242       out->print_cr("Heap dump file created");
       
   243     } else {
       
   244       // heap dump failed
       
   245       ResourceMark rm;
       
   246       char* error = dumper.error_as_C_string();
       
   247       if (error == NULL) {
       
   248         out->print_cr("Dump failed - reason unknown");
       
   249       } else {
       
   250         out->print_cr("%s", error);
       
   251       }
       
   252     }
       
   253   }
   241   }
   254   return JNI_OK;
   242   return JNI_OK;
   255 }
   243 }
   256 
   244 
   257 // Implementation of "inspectheap" command
   245 // Implementation of "inspectheap" command