955 // promotion failure does not swap spaces) because an unknown number of young
956 // collections will have swapped the spaces an unknown number of times.
957 GCTraceTime(Debug, gc, phases) tm("Pre Compact", &_gc_timer);
958 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
959 _space_info[from_space_id].set_space(heap->young_gen()->from_space());
960 _space_info[to_space_id].set_space(heap->young_gen()->to_space());
961
962 DEBUG_ONLY(add_obj_count = add_obj_size = 0;)
963 DEBUG_ONLY(mark_bitmap_count = mark_bitmap_size = 0;)
964
965 // Increment the invocation count
966 heap->increment_total_collections(true);
967
968 // We need to track unique mark sweep invocations as well.
969 _total_invocations++;
970
971 heap->print_heap_before_gc();
972 heap->trace_heap_before_gc(&_gc_tracer);
973
974 // Fill in TLABs
975 heap->accumulate_statistics_all_tlabs();
976 heap->ensure_parsability(true); // retire TLABs
977
978 if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
979 HandleMark hm; // Discard invalid handles created during verification
980 Universe::verify("Before GC");
981 }
982
983 // Verify object start arrays
984 if (VerifyObjectStartArray &&
985 VerifyBeforeGC) {
986 heap->old_gen()->verify_object_start_array();
987 }
988
989 DEBUG_ONLY(mark_bitmap()->verify_clear();)
990 DEBUG_ONLY(summary_data().verify_clear();)
991
992 // Have worker threads release resources the next time they run a task.
993 gc_task_manager()->release_all_resources();
994
995 ParCompactionManager::reset_all_bitmap_query_caches();
|
955 // promotion failure does not swap spaces) because an unknown number of young
956 // collections will have swapped the spaces an unknown number of times.
957 GCTraceTime(Debug, gc, phases) tm("Pre Compact", &_gc_timer);
958 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
959 _space_info[from_space_id].set_space(heap->young_gen()->from_space());
960 _space_info[to_space_id].set_space(heap->young_gen()->to_space());
961
962 DEBUG_ONLY(add_obj_count = add_obj_size = 0;)
963 DEBUG_ONLY(mark_bitmap_count = mark_bitmap_size = 0;)
964
965 // Increment the invocation count
966 heap->increment_total_collections(true);
967
968 // We need to track unique mark sweep invocations as well.
969 _total_invocations++;
970
971 heap->print_heap_before_gc();
972 heap->trace_heap_before_gc(&_gc_tracer);
973
974 // Fill in TLABs
975 heap->ensure_parsability(true); // retire TLABs
976
977 if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
978 HandleMark hm; // Discard invalid handles created during verification
979 Universe::verify("Before GC");
980 }
981
982 // Verify object start arrays
983 if (VerifyObjectStartArray &&
984 VerifyBeforeGC) {
985 heap->old_gen()->verify_object_start_array();
986 }
987
988 DEBUG_ONLY(mark_bitmap()->verify_clear();)
989 DEBUG_ONLY(summary_data().verify_clear();)
990
991 // Have worker threads release resources the next time they run a task.
992 gc_task_manager()->release_all_resources();
993
994 ParCompactionManager::reset_all_bitmap_query_caches();
|