comparison src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @ 4872:aa3d708d67c4

7141200: log some interesting information in ring buffers for crashes Reviewed-by: kvn, jrose, kevinw, brutisso, twisti, jmasa
author never
date Wed, 01 Feb 2012 07:59:01 -0800
parents 8aae2050e83e
children 5c86f8211d1e
comparison
equal deleted inserted replaced
4871:f067b4e0e04b 4872:aa3d708d67c4
1 /* 1 /*
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
124 } 124 }
125 125
126 void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, 126 void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
127 bool clear_all_softrefs) { 127 bool clear_all_softrefs) {
128 // Recursively traverse all live objects and mark them 128 // Recursively traverse all live objects and mark them
129 EventMark m("1 mark object");
130 TraceTime tm("phase 1", PrintGC && Verbose, true, gclog_or_tty); 129 TraceTime tm("phase 1", PrintGC && Verbose, true, gclog_or_tty);
131 GenMarkSweep::trace(" 1"); 130 GenMarkSweep::trace(" 1");
132 131
133 SharedHeap* sh = SharedHeap::heap(); 132 SharedHeap* sh = SharedHeap::heap();
134 133
290 // tracking expects us to do so. See comment under phase4. 289 // tracking expects us to do so. See comment under phase4.
291 290
292 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 291 G1CollectedHeap* g1h = G1CollectedHeap::heap();
293 Generation* pg = g1h->perm_gen(); 292 Generation* pg = g1h->perm_gen();
294 293
295 EventMark m("2 compute new addresses");
296 TraceTime tm("phase 2", PrintGC && Verbose, true, gclog_or_tty); 294 TraceTime tm("phase 2", PrintGC && Verbose, true, gclog_or_tty);
297 GenMarkSweep::trace("2"); 295 GenMarkSweep::trace("2");
298 296
299 FindFirstRegionClosure cl; 297 FindFirstRegionClosure cl;
300 g1h->heap_region_iterate(&cl); 298 g1h->heap_region_iterate(&cl);
335 void G1MarkSweep::mark_sweep_phase3() { 333 void G1MarkSweep::mark_sweep_phase3() {
336 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 334 G1CollectedHeap* g1h = G1CollectedHeap::heap();
337 Generation* pg = g1h->perm_gen(); 335 Generation* pg = g1h->perm_gen();
338 336
339 // Adjust the pointers to reflect the new locations 337 // Adjust the pointers to reflect the new locations
340 EventMark m("3 adjust pointers");
341 TraceTime tm("phase 3", PrintGC && Verbose, true, gclog_or_tty); 338 TraceTime tm("phase 3", PrintGC && Verbose, true, gclog_or_tty);
342 GenMarkSweep::trace("3"); 339 GenMarkSweep::trace("3");
343 340
344 SharedHeap* sh = SharedHeap::heap(); 341 SharedHeap* sh = SharedHeap::heap();
345 342
400 // here (perm_gen first rather than last), so we tell the validate code 397 // here (perm_gen first rather than last), so we tell the validate code
401 // to use a higher index (saved from phase2) when verifying perm_gen. 398 // to use a higher index (saved from phase2) when verifying perm_gen.
402 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 399 G1CollectedHeap* g1h = G1CollectedHeap::heap();
403 Generation* pg = g1h->perm_gen(); 400 Generation* pg = g1h->perm_gen();
404 401
405 EventMark m("4 compact heap");
406 TraceTime tm("phase 4", PrintGC && Verbose, true, gclog_or_tty); 402 TraceTime tm("phase 4", PrintGC && Verbose, true, gclog_or_tty);
407 GenMarkSweep::trace("4"); 403 GenMarkSweep::trace("4");
408 404
409 pg->compact(); 405 pg->compact();
410 406