8151674: STW phases at Concurrent GC should count in PerfCounter
Reviewed-by: jmasa, sla, tschatzl
This commit is contained in:
parent
b1e438f157
commit
7e964d8697
@ -626,6 +626,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
|||||||
|
|
||||||
NOT_PRODUCT(_overflow_counter = CMSMarkStackOverflowInterval;)
|
NOT_PRODUCT(_overflow_counter = CMSMarkStackOverflowInterval;)
|
||||||
_gc_counters = new CollectorCounters("CMS", 1);
|
_gc_counters = new CollectorCounters("CMS", 1);
|
||||||
|
_cgc_counters = new CollectorCounters("CMS stop-the-world phases", 2);
|
||||||
_completed_initialization = true;
|
_completed_initialization = true;
|
||||||
_inter_sweep_timer.start(); // start of time
|
_inter_sweep_timer.start(); // start of time
|
||||||
}
|
}
|
||||||
@ -5546,18 +5547,18 @@ void CMSCollector::reset_stw() {
|
|||||||
|
|
||||||
void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
||||||
GCTraceCPUTime tcpu;
|
GCTraceCPUTime tcpu;
|
||||||
TraceCollectorStats tcs(counters());
|
TraceCollectorStats tcs(cgc_counters());
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case CMS_op_checkpointRootsInitial: {
|
case CMS_op_checkpointRootsInitial: {
|
||||||
GCTraceTime(Info, gc) t("Pause Initial Mark", NULL, GCCause::_no_gc, true);
|
GCTraceTime(Info, gc) t("Pause Initial Mark", NULL, GCCause::_no_gc, true);
|
||||||
SvcGCMarker sgcm(SvcGCMarker::OTHER);
|
SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
|
||||||
checkpointRootsInitial();
|
checkpointRootsInitial();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMS_op_checkpointRootsFinal: {
|
case CMS_op_checkpointRootsFinal: {
|
||||||
GCTraceTime(Info, gc) t("Pause Remark", NULL, GCCause::_no_gc, true);
|
GCTraceTime(Info, gc) t("Pause Remark", NULL, GCCause::_no_gc, true);
|
||||||
SvcGCMarker sgcm(SvcGCMarker::OTHER);
|
SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
|
||||||
checkpointRootsFinal();
|
checkpointRootsFinal();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -555,6 +555,7 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||||||
|
|
||||||
// Performance Counters
|
// Performance Counters
|
||||||
CollectorCounters* _gc_counters;
|
CollectorCounters* _gc_counters;
|
||||||
|
CollectorCounters* _cgc_counters;
|
||||||
|
|
||||||
// Initialization Errors
|
// Initialization Errors
|
||||||
bool _completed_initialization;
|
bool _completed_initialization;
|
||||||
@ -930,6 +931,7 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||||||
|
|
||||||
// Performance Counter Support
|
// Performance Counter Support
|
||||||
CollectorCounters* counters() { return _gc_counters; }
|
CollectorCounters* counters() { return _gc_counters; }
|
||||||
|
CollectorCounters* cgc_counters() { return _cgc_counters; }
|
||||||
|
|
||||||
// Timer stuff
|
// Timer stuff
|
||||||
void startTimer() { assert(!_timer.is_active(), "Error"); _timer.start(); }
|
void startTimer() { assert(!_timer.is_active(), "Error"); _timer.start(); }
|
||||||
|
@ -1072,8 +1072,6 @@ void G1ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SvcGCMarker sgcm(SvcGCMarker::OTHER);
|
|
||||||
|
|
||||||
if (VerifyDuringGC) {
|
if (VerifyDuringGC) {
|
||||||
HandleMark hm; // handle scope
|
HandleMark hm; // handle scope
|
||||||
g1h->prepare_for_verify();
|
g1h->prepare_for_verify();
|
||||||
|
@ -76,6 +76,7 @@ G1MonitoringSupport::G1MonitoringSupport(G1CollectedHeap* g1h) :
|
|||||||
_g1h(g1h),
|
_g1h(g1h),
|
||||||
_incremental_collection_counters(NULL),
|
_incremental_collection_counters(NULL),
|
||||||
_full_collection_counters(NULL),
|
_full_collection_counters(NULL),
|
||||||
|
_conc_collection_counters(NULL),
|
||||||
_old_collection_counters(NULL),
|
_old_collection_counters(NULL),
|
||||||
_old_space_counters(NULL),
|
_old_space_counters(NULL),
|
||||||
_young_collection_counters(NULL),
|
_young_collection_counters(NULL),
|
||||||
@ -104,6 +105,9 @@ G1MonitoringSupport::G1MonitoringSupport(G1CollectedHeap* g1h) :
|
|||||||
// old generation collection.
|
// old generation collection.
|
||||||
_full_collection_counters =
|
_full_collection_counters =
|
||||||
new CollectorCounters("G1 stop-the-world full collections", 1);
|
new CollectorCounters("G1 stop-the-world full collections", 1);
|
||||||
|
// name "collector.2". STW phases as part of a concurrent collection.
|
||||||
|
_conc_collection_counters =
|
||||||
|
new CollectorCounters("G1 stop-the-world phases", 2);
|
||||||
|
|
||||||
// timer sampling for all counters supporting sampling only update the
|
// timer sampling for all counters supporting sampling only update the
|
||||||
// used value. See the take_sample() method. G1 requires both used and
|
// used value. See the take_sample() method. G1 requires both used and
|
||||||
|
@ -122,6 +122,8 @@ class G1MonitoringSupport : public CHeapObj<mtGC> {
|
|||||||
CollectorCounters* _incremental_collection_counters;
|
CollectorCounters* _incremental_collection_counters;
|
||||||
// full stop-the-world collections
|
// full stop-the-world collections
|
||||||
CollectorCounters* _full_collection_counters;
|
CollectorCounters* _full_collection_counters;
|
||||||
|
// stop-the-world phases in G1
|
||||||
|
CollectorCounters* _conc_collection_counters;
|
||||||
// young collection set counters. The _eden_counters,
|
// young collection set counters. The _eden_counters,
|
||||||
// _from_counters, and _to_counters are associated with
|
// _from_counters, and _to_counters are associated with
|
||||||
// this "generational" counter.
|
// this "generational" counter.
|
||||||
@ -210,6 +212,9 @@ class G1MonitoringSupport : public CHeapObj<mtGC> {
|
|||||||
CollectorCounters* full_collection_counters() {
|
CollectorCounters* full_collection_counters() {
|
||||||
return _full_collection_counters;
|
return _full_collection_counters;
|
||||||
}
|
}
|
||||||
|
CollectorCounters* conc_collection_counters() {
|
||||||
|
return _conc_collection_counters;
|
||||||
|
}
|
||||||
GenerationCounters* young_collection_counters() {
|
GenerationCounters* young_collection_counters() {
|
||||||
return _young_collection_counters;
|
return _young_collection_counters;
|
||||||
}
|
}
|
||||||
|
@ -217,6 +217,8 @@ void VM_CGC_Operation::doit() {
|
|||||||
GCTraceCPUTime tcpu;
|
GCTraceCPUTime tcpu;
|
||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
GCTraceTime(Info, gc) t(_printGCMessage, g1h->concurrent_mark()->gc_timer_cm(), GCCause::_no_gc, true);
|
GCTraceTime(Info, gc) t(_printGCMessage, g1h->concurrent_mark()->gc_timer_cm(), GCCause::_no_gc, true);
|
||||||
|
TraceCollectorStats tcs(g1h->g1mm()->conc_collection_counters());
|
||||||
|
SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
|
||||||
IsGCActiveMark x;
|
IsGCActiveMark x;
|
||||||
_cl->do_void();
|
_cl->do_void();
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ class SvcGCMarker : public StackObj {
|
|||||||
private:
|
private:
|
||||||
JvmtiGCMarker _jgcm;
|
JvmtiGCMarker _jgcm;
|
||||||
public:
|
public:
|
||||||
typedef enum { MINOR, FULL, OTHER } reason_type;
|
typedef enum { MINOR, FULL, CONCURRENT, OTHER } reason_type;
|
||||||
|
|
||||||
SvcGCMarker(reason_type reason ) {
|
SvcGCMarker(reason_type reason ) {
|
||||||
VM_GC_Operation::notify_gc_begin(reason == FULL);
|
VM_GC_Operation::notify_gc_begin(reason == FULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user