1044
1045 // Update heap occupancy information which is used as input to the soft ref
1046 // clearing policy at the next gc.
1047 Universe::update_heap_info_at_gc();
1048
1049 bool young_gen_empty = eden_empty && from_space->is_empty() &&
1050 to_space->is_empty();
1051
1052 PSCardTable* ct = heap->card_table();
1053 MemRegion old_mr = heap->old_gen()->reserved();
1054 if (young_gen_empty) {
1055 ct->clear(MemRegion(old_mr.start(), old_mr.end()));
1056 } else {
1057 ct->invalidate(MemRegion(old_mr.start(), old_mr.end()));
1058 }
1059
1060 // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1061 ClassLoaderDataGraph::purge();
1062 MetaspaceUtils::verify_metrics();
1063
1064 CodeCache::gc_epilogue();
1065 JvmtiExport::gc_epilogue();
1066
1067 #if COMPILER2_OR_JVMCI
1068 DerivedPointerTable::update_pointers();
1069 #endif
1070
1071 if (ZapUnusedHeapArea) {
1072 heap->gen_mangle_unused_area();
1073 }
1074
1075 // Update time of last GC
1076 reset_millis_since_last_gc();
1077 }
1078
1079 HeapWord*
1080 PSParallelCompact::compute_dense_prefix_via_density(const SpaceId id,
1081 bool maximum_compaction)
1082 {
1083 const size_t region_size = ParallelCompactData::RegionSize;
1084 const ParallelCompactData& sd = summary_data();
1790
1791 // Set the number of GC threads to be used in this collection
1792 gc_task_manager()->set_active_gang();
1793 gc_task_manager()->task_idle_workers();
1794
1795 GCTraceCPUTime tcpu;
1796 GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true);
1797
1798 heap->pre_full_gc_dump(&_gc_timer);
1799
1800 TraceCollectorStats tcs(counters());
1801 TraceMemoryManagerStats tms(heap->old_gc_manager(), gc_cause);
1802
1803 if (log_is_enabled(Debug, gc, heap, exit)) {
1804 accumulated_time()->start();
1805 }
1806
1807 // Let the size policy know we're starting
1808 size_policy->major_collection_begin();
1809
1810 CodeCache::gc_prologue();
1811
1812 #if COMPILER2_OR_JVMCI
1813 DerivedPointerTable::clear();
1814 #endif
1815
1816 ref_processor()->enable_discovery();
1817 ref_processor()->setup_policy(maximum_heap_compaction);
1818
1819 bool marked_for_unloading = false;
1820
1821 marking_start.update();
1822 marking_phase(vmthread_cm, maximum_heap_compaction, &_gc_tracer);
1823
1824 bool max_on_system_gc = UseMaximumCompactionOnSystemGC
1825 && GCCause::is_user_requested_gc(gc_cause);
1826 summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
1827
1828 #if COMPILER2_OR_JVMCI
1829 assert(DerivedPointerTable::is_active(), "Sanity");
1830 DerivedPointerTable::set_active(false);
|
1044
1045 // Update heap occupancy information which is used as input to the soft ref
1046 // clearing policy at the next gc.
1047 Universe::update_heap_info_at_gc();
1048
1049 bool young_gen_empty = eden_empty && from_space->is_empty() &&
1050 to_space->is_empty();
1051
1052 PSCardTable* ct = heap->card_table();
1053 MemRegion old_mr = heap->old_gen()->reserved();
1054 if (young_gen_empty) {
1055 ct->clear(MemRegion(old_mr.start(), old_mr.end()));
1056 } else {
1057 ct->invalidate(MemRegion(old_mr.start(), old_mr.end()));
1058 }
1059
1060 // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1061 ClassLoaderDataGraph::purge();
1062 MetaspaceUtils::verify_metrics();
1063
1064 JvmtiExport::gc_epilogue();
1065
1066 #if COMPILER2_OR_JVMCI
1067 DerivedPointerTable::update_pointers();
1068 #endif
1069
1070 if (ZapUnusedHeapArea) {
1071 heap->gen_mangle_unused_area();
1072 }
1073
1074 // Update time of last GC
1075 reset_millis_since_last_gc();
1076 }
1077
1078 HeapWord*
1079 PSParallelCompact::compute_dense_prefix_via_density(const SpaceId id,
1080 bool maximum_compaction)
1081 {
1082 const size_t region_size = ParallelCompactData::RegionSize;
1083 const ParallelCompactData& sd = summary_data();
1789
1790 // Set the number of GC threads to be used in this collection
1791 gc_task_manager()->set_active_gang();
1792 gc_task_manager()->task_idle_workers();
1793
1794 GCTraceCPUTime tcpu;
1795 GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true);
1796
1797 heap->pre_full_gc_dump(&_gc_timer);
1798
1799 TraceCollectorStats tcs(counters());
1800 TraceMemoryManagerStats tms(heap->old_gc_manager(), gc_cause);
1801
1802 if (log_is_enabled(Debug, gc, heap, exit)) {
1803 accumulated_time()->start();
1804 }
1805
1806 // Let the size policy know we're starting
1807 size_policy->major_collection_begin();
1808
1809 heap->prune_nmethods();
1810
1811 #if COMPILER2_OR_JVMCI
1812 DerivedPointerTable::clear();
1813 #endif
1814
1815 ref_processor()->enable_discovery();
1816 ref_processor()->setup_policy(maximum_heap_compaction);
1817
1818 bool marked_for_unloading = false;
1819
1820 marking_start.update();
1821 marking_phase(vmthread_cm, maximum_heap_compaction, &_gc_tracer);
1822
1823 bool max_on_system_gc = UseMaximumCompactionOnSystemGC
1824 && GCCause::is_user_requested_gc(gc_cause);
1825 summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
1826
1827 #if COMPILER2_OR_JVMCI
1828 assert(DerivedPointerTable::is_active(), "Sanity");
1829 DerivedPointerTable::set_active(false);
|