< prev index next >

src/hotspot/share/gc/parallel/psParallelCompact.cpp

Print this page
rev 49171 : imported patch 8185034-metaspace-cleanup-1-rename-metaspaceaux


1010                                             heap->young_gen(), heap->old_gen());
1011   }
1012 
1013   // Update heap occupancy information which is used as input to the soft ref
1014   // clearing policy at the next gc.
1015   Universe::update_heap_info_at_gc();
1016 
1017   bool young_gen_empty = eden_empty && from_space->is_empty() &&
1018     to_space->is_empty();
1019 
1020   PSCardTable* ct = heap->card_table();
1021   MemRegion old_mr = heap->old_gen()->reserved();
1022   if (young_gen_empty) {
1023     ct->clear(MemRegion(old_mr.start(), old_mr.end()));
1024   } else {
1025     ct->invalidate(MemRegion(old_mr.start(), old_mr.end()));
1026   }
1027 
1028   // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1029   ClassLoaderDataGraph::purge();
1030   MetaspaceAux::verify_metrics();
1031 
1032   CodeCache::gc_epilogue();
1033   JvmtiExport::gc_epilogue();
1034 
1035 #if COMPILER2_OR_JVMCI
1036   DerivedPointerTable::update_pointers();
1037 #endif
1038 
1039   ReferenceProcessorPhaseTimes pt(&_gc_timer, ref_processor()->num_q());
1040 
1041   ref_processor()->enqueue_discovered_references(NULL, &pt);
1042 
1043   pt.print_enqueue_phase();
1044 
1045   if (ZapUnusedHeapArea) {
1046     heap->gen_mangle_unused_area();
1047   }
1048 
1049   // Update time of last GC
1050   reset_millis_since_last_gc();


1884     }
1885 
1886     if (UsePerfData) {
1887       PSGCAdaptivePolicyCounters* const counters = heap->gc_policy_counters();
1888       counters->update_counters();
1889       counters->update_old_capacity(old_gen->capacity_in_bytes());
1890       counters->update_young_capacity(young_gen->capacity_in_bytes());
1891     }
1892 
1893     heap->resize_all_tlabs();
1894 
1895     // Resize the metaspace capacity after a collection
1896     MetaspaceGC::compute_new_size();
1897 
1898     if (log_is_enabled(Debug, gc, heap, exit)) {
1899       accumulated_time()->stop();
1900     }
1901 
1902     young_gen->print_used_change(pre_gc_values.young_gen_used());
1903     old_gen->print_used_change(pre_gc_values.old_gen_used());
1904     MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used());
1905 
1906     // Track memory usage and detect low memory
1907     MemoryService::track_memory_usage();
1908     heap->update_counters();
1909     gc_task_manager()->release_idle_workers();
1910 
1911     heap->post_full_gc_dump(&_gc_timer);
1912   }
1913 
1914 #ifdef ASSERT
1915   for (size_t i = 0; i < ParallelGCThreads + 1; ++i) {
1916     ParCompactionManager* const cm =
1917       ParCompactionManager::manager_array(int(i));
1918     assert(cm->marking_stack()->is_empty(),       "should be empty");
1919     assert(cm->region_stack()->is_empty(), "Region stack " SIZE_FORMAT " is not empty", i);
1920   }
1921 #endif // ASSERT
1922 
1923   if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
1924     HandleMark hm;  // Discard invalid handles created during verification




1010                                             heap->young_gen(), heap->old_gen());
1011   }
1012 
1013   // Update heap occupancy information which is used as input to the soft ref
1014   // clearing policy at the next gc.
1015   Universe::update_heap_info_at_gc();
1016 
1017   bool young_gen_empty = eden_empty && from_space->is_empty() &&
1018     to_space->is_empty();
1019 
1020   PSCardTable* ct = heap->card_table();
1021   MemRegion old_mr = heap->old_gen()->reserved();
1022   if (young_gen_empty) {
1023     ct->clear(MemRegion(old_mr.start(), old_mr.end()));
1024   } else {
1025     ct->invalidate(MemRegion(old_mr.start(), old_mr.end()));
1026   }
1027 
1028   // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1029   ClassLoaderDataGraph::purge();
1030   MetaspaceUtils::verify_metrics();
1031 
1032   CodeCache::gc_epilogue();
1033   JvmtiExport::gc_epilogue();
1034 
1035 #if COMPILER2_OR_JVMCI
1036   DerivedPointerTable::update_pointers();
1037 #endif
1038 
1039   ReferenceProcessorPhaseTimes pt(&_gc_timer, ref_processor()->num_q());
1040 
1041   ref_processor()->enqueue_discovered_references(NULL, &pt);
1042 
1043   pt.print_enqueue_phase();
1044 
1045   if (ZapUnusedHeapArea) {
1046     heap->gen_mangle_unused_area();
1047   }
1048 
1049   // Update time of last GC
1050   reset_millis_since_last_gc();


1884     }
1885 
1886     if (UsePerfData) {
1887       PSGCAdaptivePolicyCounters* const counters = heap->gc_policy_counters();
1888       counters->update_counters();
1889       counters->update_old_capacity(old_gen->capacity_in_bytes());
1890       counters->update_young_capacity(young_gen->capacity_in_bytes());
1891     }
1892 
1893     heap->resize_all_tlabs();
1894 
1895     // Resize the metaspace capacity after a collection
1896     MetaspaceGC::compute_new_size();
1897 
1898     if (log_is_enabled(Debug, gc, heap, exit)) {
1899       accumulated_time()->stop();
1900     }
1901 
1902     young_gen->print_used_change(pre_gc_values.young_gen_used());
1903     old_gen->print_used_change(pre_gc_values.old_gen_used());
1904     MetaspaceUtils::print_metaspace_change(pre_gc_values.metadata_used());
1905 
1906     // Track memory usage and detect low memory
1907     MemoryService::track_memory_usage();
1908     heap->update_counters();
1909     gc_task_manager()->release_idle_workers();
1910 
1911     heap->post_full_gc_dump(&_gc_timer);
1912   }
1913 
1914 #ifdef ASSERT
1915   for (size_t i = 0; i < ParallelGCThreads + 1; ++i) {
1916     ParCompactionManager* const cm =
1917       ParCompactionManager::manager_array(int(i));
1918     assert(cm->marking_stack()->is_empty(),       "should be empty");
1919     assert(cm->region_stack()->is_empty(), "Region stack " SIZE_FORMAT " is not empty", i);
1920   }
1921 #endif // ASSERT
1922 
1923   if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
1924     HandleMark hm;  // Discard invalid handles created during verification


< prev index next >