< prev index next >

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

Print this page
rev 8545 : 7012980: PSOldGen is increased if there is no space in Metaspace
Reviewed-by:
* * *
imported patch is_system_gc


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




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

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


< prev index next >