< prev index next >

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

Print this page
rev 52961 : 8212206: Refactor AdaptiveSizePolicy to separate out code related to GC overhead
Summary: Move check_gc_overhead_limit() and related code to its own class
Reviewed-by:


1872         size_t young_live = young_gen->used_in_bytes();
1873         size_t eden_live = young_gen->eden_space()->used_in_bytes();
1874         size_t old_live = old_gen->used_in_bytes();
1875         size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
1876         size_t max_old_gen_size = old_gen->max_gen_size();
1877         size_t max_eden_size = young_gen->max_size() -
1878           young_gen->from_space()->capacity_in_bytes() -
1879           young_gen->to_space()->capacity_in_bytes();
1880 
1881         // Used for diagnostics
1882         size_policy->clear_generation_free_space_flags();
1883 
1884         size_policy->compute_generations_free_space(young_live,
1885                                                     eden_live,
1886                                                     old_live,
1887                                                     cur_eden,
1888                                                     max_old_gen_size,
1889                                                     max_eden_size,
1890                                                     true /* full gc*/);
1891 
1892         size_policy->check_gc_overhead_limit(young_live,
1893                                              eden_live,
1894                                              max_old_gen_size,
1895                                              max_eden_size,
1896                                              true /* full gc*/,
1897                                              gc_cause,
1898                                              heap->soft_ref_policy());
1899 
1900         size_policy->decay_supplemental_growth(true /* full gc*/);
1901 
1902         heap->resize_old_gen(
1903           size_policy->calculated_old_free_size_in_bytes());
1904 
1905         heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
1906                                size_policy->calculated_survivor_size_in_bytes());
1907       }
1908 
1909       log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections());
1910     }
1911 
1912     if (UsePerfData) {
1913       PSGCAdaptivePolicyCounters* const counters = heap->gc_policy_counters();




1872         size_t young_live = young_gen->used_in_bytes();
1873         size_t eden_live = young_gen->eden_space()->used_in_bytes();
1874         size_t old_live = old_gen->used_in_bytes();
1875         size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
1876         size_t max_old_gen_size = old_gen->max_gen_size();
1877         size_t max_eden_size = young_gen->max_size() -
1878           young_gen->from_space()->capacity_in_bytes() -
1879           young_gen->to_space()->capacity_in_bytes();
1880 
1881         // Used for diagnostics
1882         size_policy->clear_generation_free_space_flags();
1883 
1884         size_policy->compute_generations_free_space(young_live,
1885                                                     eden_live,
1886                                                     old_live,
1887                                                     cur_eden,
1888                                                     max_old_gen_size,
1889                                                     max_eden_size,
1890                                                     true /* full gc*/);
1891 
1892         size_policy->check_gc_overhead_limit(eden_live,

1893                                              max_old_gen_size,
1894                                              max_eden_size,
1895                                              true /* full gc*/,
1896                                              gc_cause,
1897                                              heap->soft_ref_policy());
1898 
1899         size_policy->decay_supplemental_growth(true /* full gc*/);
1900 
1901         heap->resize_old_gen(
1902           size_policy->calculated_old_free_size_in_bytes());
1903 
1904         heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
1905                                size_policy->calculated_survivor_size_in_bytes());
1906       }
1907 
1908       log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections());
1909     }
1910 
1911     if (UsePerfData) {
1912       PSGCAdaptivePolicyCounters* const counters = heap->gc_policy_counters();


< prev index next >