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

Print this page




2056     adjust_roots();
2057 
2058     compaction_start.update();
2059     // Does the perm gen always have to be done serially because
2060     // klasses are used in the update of an object?
2061     compact_perm(vmthread_cm);
2062 
2063     if (UseParallelOldGCCompacting) {
2064       compact();
2065     } else {
2066       compact_serial(vmthread_cm);
2067     }
2068 
2069     // Reset the mark bitmap, summary data, and do other bookkeeping.  Must be
2070     // done before resizing.
2071     post_compact();
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: %d young_gen_capacity: %d"
2084             " perm_gen_capacity: %d ",
2085             old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes(),
2086             perm_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         // Calculate optimal free space amounts
2096         assert(young_gen->max_size() >




2056     adjust_roots();
2057 
2058     compaction_start.update();
2059     // Does the perm gen always have to be done serially because
2060     // klasses are used in the update of an object?
2061     compact_perm(vmthread_cm);
2062 
2063     if (UseParallelOldGCCompacting) {
2064       compact();
2065     } else {
2066       compact_serial(vmthread_cm);
2067     }
2068 
2069     // Reset the mark bitmap, summary data, and do other bookkeeping.  Must be
2070     // done before resizing.
2071     post_compact();
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     bool free_ratio_in_effect = false;
2077     if ((UseFreeRatioForParallelGC ||
2078          (UseFreeRatioOnlyInSystemGCForParallelGC &&
2079           gc_cause == GCCause::_java_lang_system_gc))) {
2080       ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
2081       free_ratio_in_effect = heap->try_to_shrink_by_free_ratio(true);
2082     }
2083 
2084     if (!free_ratio_in_effect && UseAdaptiveSizePolicy) {
2085       if (PrintAdaptiveSizePolicy) {
2086         gclog_or_tty->print("AdaptiveSizeStart: ");
2087         gclog_or_tty->stamp();
2088         gclog_or_tty->print_cr(" collection: %d ",
2089                        heap->total_collections());
2090         if (Verbose) {
2091           gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d"
2092             " perm_gen_capacity: %d ",
2093             old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes(),
2094             perm_gen->capacity_in_bytes());
2095         }
2096       }
2097 
2098       // Don't check if the size_policy is ready here.  Let
2099       // the size_policy check that internally.
2100       if (UseAdaptiveGenerationSizePolicyAtMajorCollection &&
2101           ((gc_cause != GCCause::_java_lang_system_gc) ||
2102             UseAdaptiveSizePolicyWithSystemGC)) {
2103         // Calculate optimal free space amounts
2104         assert(young_gen->max_size() >