Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.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 | e7dead7e90af |
children | ab4422d0ed59 |
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. |
130 // We need to track unique mark sweep invocations as well. | 130 // We need to track unique mark sweep invocations as well. |
131 _total_invocations++; | 131 _total_invocations++; |
132 | 132 |
133 AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); | 133 AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); |
134 | 134 |
135 if (PrintHeapAtGC) { | 135 heap->print_heap_before_gc(); |
136 Universe::print_heap_before_gc(); | |
137 } | |
138 | 136 |
139 // Fill in TLABs | 137 // Fill in TLABs |
140 heap->accumulate_statistics_all_tlabs(); | 138 heap->accumulate_statistics_all_tlabs(); |
141 heap->ensure_parsability(true); // retire TLABs | 139 heap->ensure_parsability(true); // retire TLABs |
142 | 140 |
375 perm_gen->object_space()->check_mangled_unused_area_complete(); | 373 perm_gen->object_space()->check_mangled_unused_area_complete(); |
376 } | 374 } |
377 | 375 |
378 NOT_PRODUCT(ref_processor()->verify_no_references_recorded()); | 376 NOT_PRODUCT(ref_processor()->verify_no_references_recorded()); |
379 | 377 |
380 if (PrintHeapAtGC) { | 378 heap->print_heap_after_gc(); |
381 Universe::print_heap_after_gc(); | |
382 } | |
383 | 379 |
384 heap->post_full_gc_dump(); | 380 heap->post_full_gc_dump(); |
385 | 381 |
386 #ifdef TRACESPINNING | 382 #ifdef TRACESPINNING |
387 ParallelTaskTerminator::print_termination_counts(); | 383 ParallelTaskTerminator::print_termination_counts(); |
502 _revisit_mdo_stack.clear(true); | 498 _revisit_mdo_stack.clear(true); |
503 } | 499 } |
504 | 500 |
505 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { | 501 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { |
506 // Recursively traverse all live objects and mark them | 502 // Recursively traverse all live objects and mark them |
507 EventMark m("1 mark object"); | |
508 TraceTime tm("phase 1", PrintGCDetails && Verbose, true, gclog_or_tty); | 503 TraceTime tm("phase 1", PrintGCDetails && Verbose, true, gclog_or_tty); |
509 trace(" 1"); | 504 trace(" 1"); |
510 | 505 |
511 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 506 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
512 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); | 507 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
561 assert(_marking_stack.is_empty(), "stack should be empty by now"); | 556 assert(_marking_stack.is_empty(), "stack should be empty by now"); |
562 } | 557 } |
563 | 558 |
564 | 559 |
565 void PSMarkSweep::mark_sweep_phase2() { | 560 void PSMarkSweep::mark_sweep_phase2() { |
566 EventMark m("2 compute new addresses"); | |
567 TraceTime tm("phase 2", PrintGCDetails && Verbose, true, gclog_or_tty); | 561 TraceTime tm("phase 2", PrintGCDetails && Verbose, true, gclog_or_tty); |
568 trace("2"); | 562 trace("2"); |
569 | 563 |
570 // Now all live objects are marked, compute the new object addresses. | 564 // Now all live objects are marked, compute the new object addresses. |
571 | 565 |
606 }; | 600 }; |
607 static PSAlwaysTrueClosure always_true; | 601 static PSAlwaysTrueClosure always_true; |
608 | 602 |
609 void PSMarkSweep::mark_sweep_phase3() { | 603 void PSMarkSweep::mark_sweep_phase3() { |
610 // Adjust the pointers to reflect the new locations | 604 // Adjust the pointers to reflect the new locations |
611 EventMark m("3 adjust pointers"); | |
612 TraceTime tm("phase 3", PrintGCDetails && Verbose, true, gclog_or_tty); | 605 TraceTime tm("phase 3", PrintGCDetails && Verbose, true, gclog_or_tty); |
613 trace("3"); | 606 trace("3"); |
614 | 607 |
615 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 608 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
616 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); | 609 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |