Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @ 10405:f2110083203d
8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author | sla |
---|---|
date | Mon, 10 Jun 2013 11:30:51 +0200 |
parents | 96c885895d22 |
children | 1772223a25a2 |
comparison
equal
deleted
inserted
replaced
10404:d0add7016434 | 10405:f2110083203d |
---|---|
91 sleepBeforeNextCycle(); | 91 sleepBeforeNextCycle(); |
92 { | 92 { |
93 ResourceMark rm; | 93 ResourceMark rm; |
94 HandleMark hm; | 94 HandleMark hm; |
95 double cycle_start = os::elapsedVTime(); | 95 double cycle_start = os::elapsedVTime(); |
96 char verbose_str[128]; | |
97 | 96 |
98 // We have to ensure that we finish scanning the root regions | 97 // We have to ensure that we finish scanning the root regions |
99 // before the next GC takes place. To ensure this we have to | 98 // before the next GC takes place. To ensure this we have to |
100 // make sure that we do not join the STS until the root regions | 99 // make sure that we do not join the STS until the root regions |
101 // have been scanned. If we did then it's possible that a | 100 // have been scanned. If we did then it's possible that a |
153 gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf secs]", | 152 gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf secs]", |
154 mark_end_sec - mark_start_sec); | 153 mark_end_sec - mark_start_sec); |
155 } | 154 } |
156 | 155 |
157 CMCheckpointRootsFinalClosure final_cl(_cm); | 156 CMCheckpointRootsFinalClosure final_cl(_cm); |
158 sprintf(verbose_str, "GC remark"); | 157 VM_CGC_Operation op(&final_cl, "GC remark", true /* needs_pll */); |
159 VM_CGC_Operation op(&final_cl, verbose_str, true /* needs_pll */); | |
160 VMThread::execute(&op); | 158 VMThread::execute(&op); |
161 } | 159 } |
162 if (cm()->restart_for_overflow()) { | 160 if (cm()->restart_for_overflow()) { |
163 if (G1TraceMarkStackOverflow) { | 161 if (G1TraceMarkStackOverflow) { |
164 gclog_or_tty->print_cr("Restarting conc marking because of MS overflow " | 162 gclog_or_tty->print_cr("Restarting conc marking because of MS overflow " |
185 jlong sleep_time_ms = mmu_tracker->when_ms(now, cleanup_prediction_ms); | 183 jlong sleep_time_ms = mmu_tracker->when_ms(now, cleanup_prediction_ms); |
186 os::sleep(current_thread, sleep_time_ms, false); | 184 os::sleep(current_thread, sleep_time_ms, false); |
187 } | 185 } |
188 | 186 |
189 CMCleanUp cl_cl(_cm); | 187 CMCleanUp cl_cl(_cm); |
190 sprintf(verbose_str, "GC cleanup"); | 188 VM_CGC_Operation op(&cl_cl, "GC cleanup", false /* needs_pll */); |
191 VM_CGC_Operation op(&cl_cl, verbose_str, false /* needs_pll */); | |
192 VMThread::execute(&op); | 189 VMThread::execute(&op); |
193 } else { | 190 } else { |
194 // We don't want to update the marking status if a GC pause | 191 // We don't want to update the marking status if a GC pause |
195 // is already underway. | 192 // is already underway. |
196 _sts.join(); | 193 _sts.join(); |
290 // completed. This will also notify the FullGCCount_lock in case a | 287 // completed. This will also notify the FullGCCount_lock in case a |
291 // Java thread is waiting for a full GC to happen (e.g., it | 288 // Java thread is waiting for a full GC to happen (e.g., it |
292 // called System.gc() with +ExplicitGCInvokesConcurrent). | 289 // called System.gc() with +ExplicitGCInvokesConcurrent). |
293 _sts.join(); | 290 _sts.join(); |
294 g1h->increment_old_marking_cycles_completed(true /* concurrent */); | 291 g1h->increment_old_marking_cycles_completed(true /* concurrent */); |
292 g1h->register_concurrent_cycle_end(); | |
295 _sts.leave(); | 293 _sts.leave(); |
296 } | 294 } |
297 assert(_should_terminate, "just checking"); | 295 assert(_should_terminate, "just checking"); |
298 | 296 |
299 terminate(); | 297 terminate(); |