提交 1f221da7 编写于 作者: J johnc

7068215: G1: Print reference processing time during remark

Summary: Displays the elapsed time taken to perform reference processing during remark as part of the PrintGCDetails output.
Reviewed-by: ysr
上级 9ab02dd4
...@@ -2163,7 +2163,21 @@ void G1RefProcTaskExecutor::execute(EnqueueTask& enq_task) { ...@@ -2163,7 +2163,21 @@ void G1RefProcTaskExecutor::execute(EnqueueTask& enq_task) {
void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
ResourceMark rm; ResourceMark rm;
HandleMark hm; HandleMark hm;
G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1CollectedHeap* g1h = G1CollectedHeap::heap();
// Is alive closure.
G1CMIsAliveClosure g1_is_alive(g1h);
// Inner scope to exclude the cleaning of the string and symbol
// tables from the displayed time.
{
bool verbose = PrintGC && PrintGCDetails;
if (verbose) {
gclog_or_tty->put(' ');
}
TraceTime t("GC ref-proc", verbose, false, gclog_or_tty);
ReferenceProcessor* rp = g1h->ref_processor(); ReferenceProcessor* rp = g1h->ref_processor();
// See the comment in G1CollectedHeap::ref_processing_init() // See the comment in G1CollectedHeap::ref_processing_init()
...@@ -2173,10 +2187,10 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { ...@@ -2173,10 +2187,10 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
rp->setup_policy(clear_all_soft_refs); rp->setup_policy(clear_all_soft_refs);
assert(_markStack.isEmpty(), "mark stack should be empty"); assert(_markStack.isEmpty(), "mark stack should be empty");
G1CMIsAliveClosure g1_is_alive(g1h);
G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap()); G1CMKeepAliveClosure g1_keep_alive(g1h, this, nextMarkBitMap());
G1CMDrainMarkingStackClosure G1CMDrainMarkingStackClosure
g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive); g1_drain_mark_stack(nextMarkBitMap(), &_markStack, &g1_keep_alive);
// We use the work gang from the G1CollectedHeap and we utilize all // We use the work gang from the G1CollectedHeap and we utilize all
// the worker threads. // the worker threads.
int active_workers = g1h->workers() ? g1h->workers()->total_workers() : 1; int active_workers = g1h->workers() ? g1h->workers()->total_workers() : 1;
...@@ -2185,7 +2199,6 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { ...@@ -2185,7 +2199,6 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
G1RefProcTaskExecutor par_task_executor(g1h, this, nextMarkBitMap(), G1RefProcTaskExecutor par_task_executor(g1h, this, nextMarkBitMap(),
g1h->workers(), active_workers); g1h->workers(), active_workers);
if (rp->processing_is_mt()) { if (rp->processing_is_mt()) {
// Set the degree of MT here. If the discovery is done MT, there // Set the degree of MT here. If the discovery is done MT, there
// may have been a different number of threads doing the discovery // may have been a different number of threads doing the discovery
...@@ -2207,7 +2220,6 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { ...@@ -2207,7 +2220,6 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
&g1_keep_alive, &g1_keep_alive,
&g1_drain_mark_stack, &g1_drain_mark_stack,
NULL); NULL);
} }
assert(_markStack.overflow() || _markStack.isEmpty(), assert(_markStack.overflow() || _markStack.isEmpty(),
...@@ -2227,6 +2239,7 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { ...@@ -2227,6 +2239,7 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
rp->verify_no_references_recorded(); rp->verify_no_references_recorded();
assert(!rp->discovery_enabled(), "should have been disabled"); assert(!rp->discovery_enabled(), "should have been disabled");
}
// Now clean up stale oops in StringTable // Now clean up stale oops in StringTable
StringTable::unlink(&g1_is_alive); StringTable::unlink(&g1_is_alive);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册