< prev index next >
src/share/vm/gc/parallel/psMarkSweep.cpp
Print this page
*** 491,501 ****
_objarray_stack.clear(true);
}
void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
// Recursively traverse all live objects and mark them
! GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", _gc_timer);
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
// Need to clear claim bits before the tracing starts.
ClassLoaderDataGraph::clear_claimed_marks();
--- 491,501 ----
_objarray_stack.clear(true);
}
void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
// Recursively traverse all live objects and mark them
! GCTraceTime(Info, gc, phases) tm("Phase 1: Mark live objects", _gc_timer);
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
// Need to clear claim bits before the tracing starts.
ClassLoaderDataGraph::clear_claimed_marks();
*** 521,530 ****
--- 521,532 ----
// Flush marking stack.
follow_stack();
// Process reference objects found during marking
{
+ GCTraceTime(Debug, gc, phases) t("Reference Processing", _gc_timer);
+
ref_processor()->setup_policy(clear_all_softrefs);
const ReferenceProcessorStats& stats =
ref_processor()->process_discovered_references(
is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL, _gc_timer);
gc_tracer()->report_gc_reference_stats(stats);
*** 532,542 ****
// This is the point where the entire marking should have completed.
assert(_marking_stack.is_empty(), "Marking should have completed");
{
! GCTraceTime(Debug, gc) t("Class Unloading", _gc_timer);
// Unload classes and purge the SystemDictionary.
bool purged_class = SystemDictionary::do_unloading(is_alive_closure());
// Unload nmethods.
--- 534,544 ----
// This is the point where the entire marking should have completed.
assert(_marking_stack.is_empty(), "Marking should have completed");
{
! GCTraceTime(Debug, gc, phases) t("Class Unloading", _gc_timer);
// Unload classes and purge the SystemDictionary.
bool purged_class = SystemDictionary::do_unloading(is_alive_closure());
// Unload nmethods.
*** 545,571 ****
// Prune dead klasses from subklass/sibling/implementor lists.
Klass::clean_weak_klass_links(is_alive_closure());
}
{
! GCTraceTime(Debug, gc) t("Scrub String Table", _gc_timer);
// Delete entries for dead interned strings.
StringTable::unlink(is_alive_closure());
}
{
! GCTraceTime(Debug, gc) t("Scrub Symbol Table", _gc_timer);
// Clean up unreferenced symbols in symbol table.
SymbolTable::unlink();
}
_gc_tracer->report_object_count_after_gc(is_alive_closure());
}
void PSMarkSweep::mark_sweep_phase2() {
! GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", _gc_timer);
// Now all live objects are marked, compute the new object addresses.
// It is not required that we traverse spaces in the same order in
// phase2, phase3 and phase4, but the ValidateMarkSweep live oops
--- 547,573 ----
// Prune dead klasses from subklass/sibling/implementor lists.
Klass::clean_weak_klass_links(is_alive_closure());
}
{
! GCTraceTime(Debug, gc, phases) t("Scrub String Table", _gc_timer);
// Delete entries for dead interned strings.
StringTable::unlink(is_alive_closure());
}
{
! GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", _gc_timer);
// Clean up unreferenced symbols in symbol table.
SymbolTable::unlink();
}
_gc_tracer->report_object_count_after_gc(is_alive_closure());
}
void PSMarkSweep::mark_sweep_phase2() {
! GCTraceTime(Info, gc, phases) tm("Phase 2: Compute new object addresses", _gc_timer);
// Now all live objects are marked, compute the new object addresses.
// It is not required that we traverse spaces in the same order in
// phase2, phase3 and phase4, but the ValidateMarkSweep live oops
*** 581,591 ****
old_gen->precompact();
}
void PSMarkSweep::mark_sweep_phase3() {
// Adjust the pointers to reflect the new locations
! GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", _gc_timer);
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSYoungGen* young_gen = heap->young_gen();
PSOldGen* old_gen = heap->old_gen();
--- 583,593 ----
old_gen->precompact();
}
void PSMarkSweep::mark_sweep_phase3() {
// Adjust the pointers to reflect the new locations
! GCTraceTime(Info, gc, phases) tm("Phase 3: Adjust pointers", _gc_timer);
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSYoungGen* young_gen = heap->young_gen();
PSOldGen* old_gen = heap->old_gen();
*** 621,631 ****
old_gen->adjust_pointers();
}
void PSMarkSweep::mark_sweep_phase4() {
EventMark m("4 compact heap");
! GCTraceTime(Trace, gc) tm("Phase 4: Move objects", _gc_timer);
// All pointers are now adjusted, move objects accordingly
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSYoungGen* young_gen = heap->young_gen();
--- 623,633 ----
old_gen->adjust_pointers();
}
void PSMarkSweep::mark_sweep_phase4() {
EventMark m("4 compact heap");
! GCTraceTime(Info, gc, phases) tm("Phase 4: Move objects", _gc_timer);
// All pointers are now adjusted, move objects accordingly
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSYoungGen* young_gen = heap->young_gen();
< prev index next >