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:
parent
dc5a35154d
commit
3e6220b1ab
@ -103,6 +103,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
|
|||||||
case _last_ditch_collection:
|
case _last_ditch_collection:
|
||||||
return "Last ditch collection";
|
return "Last ditch collection";
|
||||||
|
|
||||||
|
case _dcmd_gc_run:
|
||||||
|
return "Diagnostic Command";
|
||||||
|
|
||||||
case _last_gc_cause:
|
case _last_gc_cause:
|
||||||
return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";
|
return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";
|
||||||
|
|
||||||
|
@ -74,6 +74,9 @@ class GCCause : public AllStatic {
|
|||||||
_g1_humongous_allocation,
|
_g1_humongous_allocation,
|
||||||
|
|
||||||
_last_ditch_collection,
|
_last_ditch_collection,
|
||||||
|
|
||||||
|
_dcmd_gc_run,
|
||||||
|
|
||||||
_last_gc_cause
|
_last_gc_cause
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ int VMUptimeDCmd::num_arguments() {
|
|||||||
|
|
||||||
void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
|
void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
|
||||||
if (!DisableExplicitGC) {
|
if (!DisableExplicitGC) {
|
||||||
Universe::heap()->collect(GCCause::_java_lang_system_gc);
|
Universe::heap()->collect(GCCause::_dcmd_gc_run);
|
||||||
} else {
|
} else {
|
||||||
output()->print_cr("Explicit GC is disabled, no GC has been performed.");
|
output()->print_cr("Explicit GC is disabled, no GC has been performed.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user