28 #include "classfile/javaClasses.inline.hpp" |
28 #include "classfile/javaClasses.inline.hpp" |
29 #include "classfile/stringTable.hpp" |
29 #include "classfile/stringTable.hpp" |
30 #include "classfile/symbolTable.hpp" |
30 #include "classfile/symbolTable.hpp" |
31 #include "classfile/systemDictionary.hpp" |
31 #include "classfile/systemDictionary.hpp" |
32 #include "code/codeCache.hpp" |
32 #include "code/codeCache.hpp" |
33 #include "gc/parallel/gcTaskManager.hpp" |
|
34 #include "gc/parallel/parallelArguments.hpp" |
33 #include "gc/parallel/parallelArguments.hpp" |
35 #include "gc/parallel/parallelScavengeHeap.inline.hpp" |
34 #include "gc/parallel/parallelScavengeHeap.inline.hpp" |
36 #include "gc/parallel/parMarkBitMap.inline.hpp" |
35 #include "gc/parallel/parMarkBitMap.inline.hpp" |
37 #include "gc/parallel/psAdaptiveSizePolicy.hpp" |
36 #include "gc/parallel/psAdaptiveSizePolicy.hpp" |
38 #include "gc/parallel/psCompactionManager.inline.hpp" |
37 #include "gc/parallel/psCompactionManager.inline.hpp" |
1016 } |
1015 } |
1017 |
1016 |
1018 DEBUG_ONLY(mark_bitmap()->verify_clear();) |
1017 DEBUG_ONLY(mark_bitmap()->verify_clear();) |
1019 DEBUG_ONLY(summary_data().verify_clear();) |
1018 DEBUG_ONLY(summary_data().verify_clear();) |
1020 |
1019 |
1021 // Have worker threads release resources the next time they run a task. |
|
1022 gc_task_manager()->release_all_resources(); |
|
1023 |
|
1024 ParCompactionManager::reset_all_bitmap_query_caches(); |
1020 ParCompactionManager::reset_all_bitmap_query_caches(); |
1025 } |
1021 } |
1026 |
1022 |
1027 void PSParallelCompact::post_compact() |
1023 void PSParallelCompact::post_compact() |
1028 { |
1024 { |
1783 |
1779 |
1784 const PreGenGCValues pre_gc_values = heap->get_pre_gc_values(); |
1780 const PreGenGCValues pre_gc_values = heap->get_pre_gc_values(); |
1785 |
1781 |
1786 // Get the compaction manager reserved for the VM thread. |
1782 // Get the compaction manager reserved for the VM thread. |
1787 ParCompactionManager* const vmthread_cm = |
1783 ParCompactionManager* const vmthread_cm = |
1788 ParCompactionManager::manager_array(gc_task_manager()->workers()); |
1784 ParCompactionManager::manager_array(ParallelScavengeHeap::heap()->workers().total_workers()); |
1789 |
1785 |
1790 { |
1786 { |
1791 ResourceMark rm; |
1787 ResourceMark rm; |
1792 HandleMark hm; |
1788 HandleMark hm; |
1793 |
1789 |
1794 const uint active_workers = |
1790 const uint active_workers = |
1795 WorkerPolicy::calc_active_workers(ParallelScavengeHeap::heap()->workers().total_workers(), |
1791 WorkerPolicy::calc_active_workers(ParallelScavengeHeap::heap()->workers().total_workers(), |
1796 ParallelScavengeHeap::heap()->workers().active_workers(), |
1792 ParallelScavengeHeap::heap()->workers().active_workers(), |
1797 Threads::number_of_non_daemon_threads()); |
1793 Threads::number_of_non_daemon_threads()); |
1798 ParallelScavengeHeap::heap()->workers().update_active_workers(active_workers); |
1794 ParallelScavengeHeap::heap()->workers().update_active_workers(active_workers); |
1799 |
|
1800 // Set the number of GC threads to be used in this collection |
|
1801 gc_task_manager()->set_active_gang(); |
|
1802 gc_task_manager()->task_idle_workers(); |
|
1803 |
1795 |
1804 GCTraceCPUTime tcpu; |
1796 GCTraceCPUTime tcpu; |
1805 GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true); |
1797 GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true); |
1806 |
1798 |
1807 heap->pre_full_gc_dump(&_gc_timer); |
1799 heap->pre_full_gc_dump(&_gc_timer); |
1934 heap->print_heap_change(pre_gc_values); |
1926 heap->print_heap_change(pre_gc_values); |
1935 |
1927 |
1936 // Track memory usage and detect low memory |
1928 // Track memory usage and detect low memory |
1937 MemoryService::track_memory_usage(); |
1929 MemoryService::track_memory_usage(); |
1938 heap->update_counters(); |
1930 heap->update_counters(); |
1939 gc_task_manager()->release_idle_workers(); |
|
1940 |
1931 |
1941 heap->post_full_gc_dump(&_gc_timer); |
1932 heap->post_full_gc_dump(&_gc_timer); |
1942 } |
1933 } |
1943 |
1934 |
1944 #ifdef ASSERT |
1935 #ifdef ASSERT |
1973 heap->trace_heap_after_gc(&_gc_tracer); |
1964 heap->trace_heap_after_gc(&_gc_tracer); |
1974 |
1965 |
1975 log_debug(gc, task, time)("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, |
1966 log_debug(gc, task, time)("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, |
1976 marking_start.ticks(), compaction_start.ticks(), |
1967 marking_start.ticks(), compaction_start.ticks(), |
1977 collection_exit.ticks()); |
1968 collection_exit.ticks()); |
1978 gc_task_manager()->print_task_time_stamps(); |
|
1979 |
1969 |
1980 #ifdef TRACESPINNING |
1970 #ifdef TRACESPINNING |
1981 ParallelTaskTerminator::print_termination_counts(); |
1971 ParallelTaskTerminator::print_termination_counts(); |
1982 #endif |
1972 #endif |
1983 |
1973 |
1997 MutableSpace* const eden_space = young_gen->eden_space(); |
1987 MutableSpace* const eden_space = young_gen->eden_space(); |
1998 assert(!eden_space->is_empty(), "eden must be non-empty"); |
1988 assert(!eden_space->is_empty(), "eden must be non-empty"); |
1999 assert(young_gen->virtual_space()->alignment() == |
1989 assert(young_gen->virtual_space()->alignment() == |
2000 old_gen->virtual_space()->alignment(), "alignments do not match"); |
1990 old_gen->virtual_space()->alignment(), "alignments do not match"); |
2001 |
1991 |
2002 // We also return false when it's a heterogenous heap because old generation cannot absorb data from eden |
1992 // We also return false when it's a heterogeneous heap because old generation cannot absorb data from eden |
2003 // when it is allocated on different memory (example, nv-dimm) than young. |
1993 // when it is allocated on different memory (example, nv-dimm) than young. |
2004 if (!(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary) || |
1994 if (!(UseAdaptiveSizePolicy && UseAdaptiveGCBoundary) || |
2005 ParallelArguments::is_heterogeneous_heap()) { |
1995 ParallelArguments::is_heterogeneous_heap()) { |
2006 return false; |
1996 return false; |
2007 } |
1997 } |
2262 ParallelOldTracer *gc_tracer) { |
2246 ParallelOldTracer *gc_tracer) { |
2263 // Recursively traverse all live objects and mark them |
2247 // Recursively traverse all live objects and mark them |
2264 GCTraceTime(Info, gc, phases) tm("Marking Phase", &_gc_timer); |
2248 GCTraceTime(Info, gc, phases) tm("Marking Phase", &_gc_timer); |
2265 |
2249 |
2266 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); |
2250 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); |
2267 uint parallel_gc_threads = heap->gc_task_manager()->workers(); |
2251 uint active_gc_threads = ParallelScavengeHeap::heap()->workers().active_workers(); |
2268 uint active_gc_threads = heap->gc_task_manager()->active_workers(); |
|
2269 TaskQueueSetSuper* qset = ParCompactionManager::stack_array(); |
|
2270 TaskTerminator terminator(active_gc_threads, qset); |
|
2271 |
2252 |
2272 PCMarkAndPushClosure mark_and_push_closure(cm); |
2253 PCMarkAndPushClosure mark_and_push_closure(cm); |
2273 ParCompactionManager::FollowStackClosure follow_stack_closure(cm); |
2254 ParCompactionManager::FollowStackClosure follow_stack_closure(cm); |
2274 |
2255 |
2275 // Need new claim bits before marking starts. |
2256 // Need new claim bits before marking starts. |