< prev index next >

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

Print this page
rev 8330 : 7012980: PSOldGen is increased if there is no space in Metaspace
Reviewed-by:


2073 
2074     // Let the size policy know we're done
2075     size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause);
2076 
2077     if (UseAdaptiveSizePolicy) {
2078       if (PrintAdaptiveSizePolicy) {
2079         gclog_or_tty->print("AdaptiveSizeStart: ");
2080         gclog_or_tty->stamp();
2081         gclog_or_tty->print_cr(" collection: %d ",
2082                        heap->total_collections());
2083         if (Verbose) {
2084           gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
2085             " young_gen_capacity: " SIZE_FORMAT,
2086             old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
2087         }
2088       }
2089 
2090       // Don't check if the size_policy is ready here.  Let
2091       // the size_policy check that internally.
2092       if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
2093           ((gc_cause != GCCause::_java_lang_system_gc) ||
2094             UseAdaptiveSizePolicyWithSystemGC)) {
2095         // Swap the survivor spaces if from_space is empty. The
2096         // resize_young_gen() called below is normally used after
2097         // a successful young GC and swapping of survivor spaces;
2098         // otherwise, it will fail to resize the young gen with
2099         // the current implementation.
2100         if (young_gen->from_space()->is_empty()) {
2101           young_gen->from_space()->clear(SpaceDecorator::Mangle);
2102           young_gen->swap_spaces();
2103         }
2104 
2105         // Calculate optimal free space amounts
2106         assert(young_gen->max_size() >
2107           young_gen->from_space()->capacity_in_bytes() +
2108           young_gen->to_space()->capacity_in_bytes(),
2109           "Sizes of space in young gen are out-of-bounds");
2110 
2111         size_t young_live = young_gen->used_in_bytes();
2112         size_t eden_live = young_gen->eden_space()->used_in_bytes();
2113         size_t old_live = old_gen->used_in_bytes();
2114         size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();




2073 
2074     // Let the size policy know we're done
2075     size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause);
2076 
2077     if (UseAdaptiveSizePolicy) {
2078       if (PrintAdaptiveSizePolicy) {
2079         gclog_or_tty->print("AdaptiveSizeStart: ");
2080         gclog_or_tty->stamp();
2081         gclog_or_tty->print_cr(" collection: %d ",
2082                        heap->total_collections());
2083         if (Verbose) {
2084           gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
2085             " young_gen_capacity: " SIZE_FORMAT,
2086             old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
2087         }
2088       }
2089 
2090       // Don't check if the size_policy is ready here.  Let
2091       // the size_policy check that internally.
2092       if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
2093           AdaptiveSizePolicy::should_update_promo_stats(gc_cause)) {

2094         // Swap the survivor spaces if from_space is empty. The
2095         // resize_young_gen() called below is normally used after
2096         // a successful young GC and swapping of survivor spaces;
2097         // otherwise, it will fail to resize the young gen with
2098         // the current implementation.
2099         if (young_gen->from_space()->is_empty()) {
2100           young_gen->from_space()->clear(SpaceDecorator::Mangle);
2101           young_gen->swap_spaces();
2102         }
2103 
2104         // Calculate optimal free space amounts
2105         assert(young_gen->max_size() >
2106           young_gen->from_space()->capacity_in_bytes() +
2107           young_gen->to_space()->capacity_in_bytes(),
2108           "Sizes of space in young gen are out-of-bounds");
2109 
2110         size_t young_live = young_gen->used_in_bytes();
2111         size_t eden_live = young_gen->eden_space()->used_in_bytes();
2112         size_t old_live = old_gen->used_in_bytes();
2113         size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();


< prev index next >