src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc_implementation/parallelScavenge

src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp

Print this page
rev 6362 : 8042298: Remove the names gen0 and gen1 from the GC code
Summary: Renamed gen0 and gen1 to young and old throughout the GC code.
Reviewed-by:


2043     ParCompactionManager::manager_array(gc_task_manager()->workers());
2044 
2045   // Place after pre_compact() where the number of invocations is incremented.
2046   AdaptiveSizePolicyOutput(size_policy, heap->total_collections());
2047 
2048   {
2049     ResourceMark rm;
2050     HandleMark hm;
2051 
2052     // Set the number of GC threads to be used in this collection
2053     gc_task_manager()->set_active_gang();
2054     gc_task_manager()->task_idle_workers();
2055     heap->set_par_threads(gc_task_manager()->active_workers());
2056 
2057     gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
2058     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
2059     GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
2060     TraceCollectorStats tcs(counters());
2061     TraceMemoryManagerStats tms(true /* Full GC */,gc_cause);
2062 
2063     if (TraceGen1Time) accumulated_time()->start();
2064 
2065     // Let the size policy know we're starting
2066     size_policy->major_collection_begin();
2067 
2068     CodeCache::gc_prologue();
2069     Threads::gc_prologue();
2070 
2071     COMPILER2_PRESENT(DerivedPointerTable::clear());
2072 
2073     ref_processor()->enable_discovery(true /*verify_disabled*/, true /*verify_no_refs*/);
2074     ref_processor()->setup_policy(maximum_heap_compaction);
2075 
2076     bool marked_for_unloading = false;
2077 
2078     marking_start.update();
2079     marking_phase(vmthread_cm, maximum_heap_compaction, &_gc_tracer);
2080 
2081     bool max_on_system_gc = UseMaximumCompactionOnSystemGC
2082       && gc_cause == GCCause::_java_lang_system_gc;
2083     summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);


2170                                size_policy->calculated_survivor_size_in_bytes());
2171       }
2172       if (PrintAdaptiveSizePolicy) {
2173         gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
2174                        heap->total_collections());
2175       }
2176     }
2177 
2178     if (UsePerfData) {
2179       PSGCAdaptivePolicyCounters* const counters = heap->gc_policy_counters();
2180       counters->update_counters();
2181       counters->update_old_capacity(old_gen->capacity_in_bytes());
2182       counters->update_young_capacity(young_gen->capacity_in_bytes());
2183     }
2184 
2185     heap->resize_all_tlabs();
2186 
2187     // Resize the metaspace capacity after a collection
2188     MetaspaceGC::compute_new_size();
2189 
2190     if (TraceGen1Time) accumulated_time()->stop();
2191 
2192     if (PrintGC) {
2193       if (PrintGCDetails) {
2194         // No GC timestamp here.  This is after GC so it would be confusing.
2195         young_gen->print_used_change(pre_gc_values.young_gen_used());
2196         old_gen->print_used_change(pre_gc_values.old_gen_used());
2197         heap->print_heap_change(pre_gc_values.heap_used());
2198         MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used());
2199       } else {
2200         heap->print_heap_change(pre_gc_values.heap_used());
2201       }
2202     }
2203 
2204     // Track memory usage and detect low memory
2205     MemoryService::track_memory_usage();
2206     heap->update_counters();
2207     gc_task_manager()->release_idle_workers();
2208   }
2209 
2210 #ifdef ASSERT




2043     ParCompactionManager::manager_array(gc_task_manager()->workers());
2044 
2045   // Place after pre_compact() where the number of invocations is incremented.
2046   AdaptiveSizePolicyOutput(size_policy, heap->total_collections());
2047 
2048   {
2049     ResourceMark rm;
2050     HandleMark hm;
2051 
2052     // Set the number of GC threads to be used in this collection
2053     gc_task_manager()->set_active_gang();
2054     gc_task_manager()->task_idle_workers();
2055     heap->set_par_threads(gc_task_manager()->active_workers());
2056 
2057     gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
2058     TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
2059     GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL);
2060     TraceCollectorStats tcs(counters());
2061     TraceMemoryManagerStats tms(true /* Full GC */,gc_cause);
2062 
2063     if (TraceOldGenTime) accumulated_time()->start();
2064 
2065     // Let the size policy know we're starting
2066     size_policy->major_collection_begin();
2067 
2068     CodeCache::gc_prologue();
2069     Threads::gc_prologue();
2070 
2071     COMPILER2_PRESENT(DerivedPointerTable::clear());
2072 
2073     ref_processor()->enable_discovery(true /*verify_disabled*/, true /*verify_no_refs*/);
2074     ref_processor()->setup_policy(maximum_heap_compaction);
2075 
2076     bool marked_for_unloading = false;
2077 
2078     marking_start.update();
2079     marking_phase(vmthread_cm, maximum_heap_compaction, &_gc_tracer);
2080 
2081     bool max_on_system_gc = UseMaximumCompactionOnSystemGC
2082       && gc_cause == GCCause::_java_lang_system_gc;
2083     summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);


2170                                size_policy->calculated_survivor_size_in_bytes());
2171       }
2172       if (PrintAdaptiveSizePolicy) {
2173         gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
2174                        heap->total_collections());
2175       }
2176     }
2177 
2178     if (UsePerfData) {
2179       PSGCAdaptivePolicyCounters* const counters = heap->gc_policy_counters();
2180       counters->update_counters();
2181       counters->update_old_capacity(old_gen->capacity_in_bytes());
2182       counters->update_young_capacity(young_gen->capacity_in_bytes());
2183     }
2184 
2185     heap->resize_all_tlabs();
2186 
2187     // Resize the metaspace capacity after a collection
2188     MetaspaceGC::compute_new_size();
2189 
2190     if (TraceOldGenTime) accumulated_time()->stop();
2191 
2192     if (PrintGC) {
2193       if (PrintGCDetails) {
2194         // No GC timestamp here.  This is after GC so it would be confusing.
2195         young_gen->print_used_change(pre_gc_values.young_gen_used());
2196         old_gen->print_used_change(pre_gc_values.old_gen_used());
2197         heap->print_heap_change(pre_gc_values.heap_used());
2198         MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used());
2199       } else {
2200         heap->print_heap_change(pre_gc_values.heap_used());
2201       }
2202     }
2203 
2204     // Track memory usage and detect low memory
2205     MemoryService::track_memory_usage();
2206     heap->update_counters();
2207     gc_task_manager()->release_idle_workers();
2208   }
2209 
2210 #ifdef ASSERT


src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File