8068589: GCCause should distinguish jcmd GC.run from System.gc()

GCCause which is caused by GC.run diagnostic command should be different from System.gc() .

Reviewed-by: sla, tamao
This commit is contained in:
Yasumasa Suenaga 2015-02-04 22:21:08 +09:00
parent dc5a35154d
commit 3e6220b1ab
3 changed files with 7 additions and 1 deletions

View File

@ -103,6 +103,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
case _last_ditch_collection:
return "Last ditch collection";
case _dcmd_gc_run:
return "Diagnostic Command";
case _last_gc_cause:
return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";

View File

@ -74,6 +74,9 @@ class GCCause : public AllStatic {
_g1_humongous_allocation,
_last_ditch_collection,
_dcmd_gc_run,
_last_gc_cause
};

View File

@ -267,7 +267,7 @@ int VMUptimeDCmd::num_arguments() {
void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
if (!DisableExplicitGC) {
Universe::heap()->collect(GCCause::_java_lang_system_gc);
Universe::heap()->collect(GCCause::_dcmd_gc_run);
} else {
output()->print_cr("Explicit GC is disabled, no GC has been performed.");
}