1879N/A * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Defined if the granularity of the time measurements is potentially too large. 0N/A // Mark-sweep-compact 0N/A // Variables that estimate pause times as a function of generation 0N/A // Alignment comes from that used in ReservedSpace. 0N/A // Start the concurrent timer here so that the first 0N/A // concurrent_phases_begin() measures a finite mutator 0N/A // time. A finite mutator time is used to determine 0N/A // if a concurrent collection has been started. If this 0N/A // proves to be a problem, use some explicit flag to 0N/A // signal that a concurrent collection has been started. 0N/A // For now assume no other daemon threads are taking alway 0N/A // cpu's from the application. 0N/A // When the precleaning and sweeping phases use multiple 0N/A // threads, change one_processor_fraction to 0N/A // concurrent_processor_fraction(). 0N/A "\nCMSAdaptiveSizePolicy::scaled_concurrent_collection_cost(%f) " 0N/A "_latest_cms_concurrent_marking_cost %f " 0N/A "_latest_cms_concurrent_precleaning_cost %f " 0N/A "_latest_cms_concurrent_sweeping_cost %f " 0N/A "concurrent_processor_fraction %f " 0N/A "concurrent_cost %f ",
0N/A // When the precleaning and sweeping phases use multiple 0N/A // threads, change one_processor_fraction to 0N/A // concurrent_processor_fraction(). 0N/A "\nCMSAdaptiveSizePolicy::scaled_concurrent_collection_time " 0N/A "_latest_cms_concurrent_marking_time_secs %f " 0N/A "_latest_cms_concurrent_precleaning_time_secs %f " 0N/A "_latest_cms_concurrent_sweeping_time_secs %f " 0N/A "concurrent_processor_fraction %f " 0N/A "latest_cms_sum_concurrent_phases_time_secs %f ",
0N/A // Get the equivalent of the free space 0N/A // that is available for promotions in the CMS generation 0N/A // and use that to update _minor_pause_old_estimator 0N/A // Don't implement this until it is needed. A warning is 0N/A // printed if _minor_pause_old_estimator is used. 0N/A // Update the interval time 0N/A ":concurrent marking time (s) %f",
0N/A "CMSAdaptiveSizePolicy::concurrent_precleaning_begin()");
0N/A // May be set again by a second call during the same collection. 0N/A ":concurrent precleaning time (s) %f",
0N/A "CMSAdaptiveSizePolicy::concurrent_sweeping_begin()");
0N/A ":concurrent sweeping time (s) %f",
0N/A // Update the concurrent timer 0N/A // Cost of collection (unit-less) 0N/A // Total interval for collection. May not be valid. Tests 0N/A // below determine whether to use this. 0N/A "_latest_cms_reset_end_to_initial_mark_start_secs %f \n" 0N/A "_latest_cms_initial_mark_start_to_end_time_secs %f \n" 0N/A "_latest_cms_remark_start_to_end_time_secs %f \n" 0N/A "_latest_cms_concurrent_marking_time_secs %f \n" 0N/A "_latest_cms_concurrent_precleaning_time_secs %f \n" 0N/A "_latest_cms_concurrent_sweeping_time_secs %f \n" 0N/A "latest_cms_sum_concurrent_phases_time_secs %f \n" 0N/A "_latest_cms_collection_end_to_collection_start_secs %f \n" 0N/A "concurrent_processor_fraction %f",
0N/A "Bad interval between cms collections");
0N/A // Sample for performance counter 0N/A // STW costs (initial and remark pauses) 0N/A // Cost of collection (unit-less) 0N/A "Bad initial mark pause");
0N/A "Bad remark pause");
0N/A // cost for the STW phases of the concurrent collection. 0N/A // Average this ms cost into all the other types gc costs 0N/A "concurrent gc cost: %f average: %f",
0N/A " processor fraction: %f",
0N/A // Gather information for estimating future behavior 0N/A // This estimate uses the average eden size. It could also 0N/A // have used the latest eden size. Which is better? 0N/A // The concurrent phases keeps track of it's own mutator interval 0N/A // with this timer. This allows the stop-the-world phase to 0N/A // be included in the mutator time so that the stop-the-world time 0N/A // is not double counted. Reset and start it. 0N/A // The mutator time between STW phases does not include the 0N/A // concurrent collection time. 0N/A // Update the interval time 0N/A // Reset for the initial mark 0N/A "cmsAdaptiveSizePolicy::checkpoint_roots_initial_end: " 0N/A // Start accumumlating time for the remark in the STW timer. 0N/A // Total initial mark pause + remark pause. 0N/A // Sample total for initial mark + remark 0N/A // Don't start the STW times here because the concurrent 0N/A // sweep and reset has not happened. 0N/A // Keep the old comment above in case I don't understand 0N/A // what is going on but now 0N/A // Start the STW timer because it is used by ms_collection_begin() 0N/A // and ms_collection_end() to get the sweep time if a MS is being 0N/A // done in the foreground. 0N/A // This assertion may fail because of time stamp gradularity. 0N/A // Comment it out and investiage it at a later time. The large 0N/A // time stamp granularity occurs on some older linux systems. 0N/A "There should not be any concurrent time");
0N/A // A concurrent collection did not start. Mutator time 0N/A // between collections comes from the STW MSC timer. 0N/A // The concurrent collection did start so count the mutator 0N/A // time to the start of the concurrent collection. In this 0N/A // case the _latest_cms_msc_end_to_msc_start_time_secs measures 0N/A // the time between the initial mark or remark and the 0N/A // start of the MSC. That has no real meaning. 0N/A " mutator_time_in_seconds %f \n" 0N/A " _latest_cms_initial_mark_start_to_end_time_secs %f\n" 0N/A " _latest_cms_remark_start_to_end_time_secs %f\n" 0N/A " latest_cms_sum_concurrent_phases_time_secs %f\n" 0N/A " msc_pause_in_seconds %f\n",
0N/A // The concurrent cost is wasted cost but it should be 0N/A // Initial mark and remark, also wasted. 0N/A "_latest_cms_collection_end_to_collection_start_secs %f\n" 0N/A "_latest_cms_msc_end_to_msc_start_time_secs %f\n" 0N/A "_latest_cms_initial_mark_start_to_end_time_secs %f\n" 0N/A "_latest_cms_remark_start_to_end_time_secs %f\n" 0N/A "latest_cms_sum_concurrent_phases_time_secs %f\n",
0N/A "latest_cms_sum_concurrent_phases_time_secs %f\n" 0N/A "STW_time_in_seconds %f\n" 0N/A "msc_pause_in_seconds %f\n",
0N/A // Average this ms cost into all the other types gc costs 0N/A // Sample for performance counter 0N/A "MSC gc cost: %f average: %f",
cost,
0N/A // Can this call be put into the epilogue? 0N/A // The concurrent phases keeps track of it's own mutator interval 0N/A // with this timer. This allows the stop-the-world phase to 0N/A // be included in the mutator time so that the stop-the-world time 0N/A // is not double counted. Reset and start it. 0N/A // The MS collection is a foreground collection that does all 0N/A // the parts of a mostly concurrent collection. 0N/A // For this collection include the cost of the 0N/A // all concurrent time (scaled down by the 0N/A // concurrent_processor_fraction). Some 0N/A // may be zero if the baton was passed before 0N/A // concurrent marking 0N/A // STW after baton was passed (STW_in_foreground_in_seconds) 0N/A "STW_in_foreground_in_seconds %f " 0N/A "_latest_cms_initial_mark_start_to_end_time_secs %f " 0N/A "_latest_cms_remark_start_to_end_time_secs %f " 0N/A "latest_cms_sum_concurrent_phases_time_secs %f " 0N/A "_latest_cms_ms_marking_start_to_end_time_secs %f " 0N/A "_latest_cms_ms_end_to_ms_start %f",
0N/A "marking done twice?");
0N/A // Use the STW costs from the initial mark and remark plus 0N/A // the cost of the concurrent phase to calculate a 0N/A "latest_cms_sum_concurrent_phases_time_secs %f " 0N/A "interval_in_seconds %f",
0N/A // Average this ms cost into all the other types gc costs 0N/A // Sample for performance counter 0N/A // Consider putting this code (here to end) into a 0N/A // method for convenience. 0N/A // The concurrent phases keeps track of it's own mutator interval 0N/A // with this timer. This allows the stop-the-world phase to 0N/A // be included in the mutator time so that the stop-the-world time 0N/A // is not double counted. Reset and start it. 0N/A // Start accumumlating time for the marking in the STW timer. 0N/A "msc_collection_marking_end: mutator time %f",
0N/A// Cost of collection (unit-less) 0N/A // Cost of collection (unit-less) 0N/A "CMSAdaptiveSizePolicy::adjust_eden_for_pause_time " 0N/A "adjusting eden for pause time. " 0N/A "CMSAdaptiveSizePolicy::adjust_eden_for_throughput " 0N/A "adjusting eden for throughput. " 0N/A "CMSAdaptiveSizePolicy::adjust_eden_for_footprint " 0N/A "adjusting eden for footprint. " 0N/A// The eden and promo versions should be combined if possible. 0N/A// They are the same except that the sizes of the decrement 0N/A// and increment are different for eden and promo. 0N/A "CMSAdaptiveSizePolicy::compute_young_generation_free_space: " 0N/A // Used for diagnostics 0N/A // If the minor pause is too long, shrink the young gen. 0N/A // The remark or initial pauses are not meeting the goal. Should 0N/A // the generation be shrunk? 0N/A // If the remark or initial pause is too long and this is the 0N/A // first young gen collection after a cms collection, shrink 0N/A // If not the first young gen collection after a cms collection, 0N/A // don't do anything. In this case an adjustment has already 0N/A // been made and the results of the adjustment has not yet been 0N/A "CMSAdaptiveSizePolicy::compute_young_generation_free_space limits:" 0N/A // Move this test up to caller like the adjust_eden_for_pause_time() 0N/A "CMSAdaptiveSizePolicy::adjust_promo_for_pause_time " 0N/A "adjusting promo for pause time. " 0N/A// Try to share this with PS. 0N/A // Calculate the change to use for the tenured gen. 0N/A // Can the increment to the generation be scaled? 0N/A // Scaling is not going to work. If the major gc time is the 0N/A // larger than the other GC costs, give it a full increment. 0N/A // Don't expect to get here but it's ok if it does 0N/A // in the product build since the delta will be 0 0N/A // and nothing will change. 0N/A assert(
false,
"Unexpected value for gc costs");
0N/A "CMSAdaptiveSizePolicy::adjust_promo_for_throughput " 0N/A "adjusting promo for throughput. " 0N/A "CMSAdaptiveSizePolicy::adjust_promo_for_footprint " 0N/A "adjusting promo for footprint. " 0N/A // any connection to the read free space 0N/A "CMSAdaptiveSizePolicy::compute_tenured_generation_free_space: " 0N/A // Used for diagnostics 0N/A // Nothing to do since the minor collections are too large and 0N/A // this method only deals with the cms generation. 0N/A "CMSAdaptiveSizePolicy::compute_tenured_generation_free_space limits:" 0N/A "survivor_limit too small");
0N/A // Change UsePSAdaptiveSurvivorSizePolicy -> UseAdaptiveSurvivorSizePolicy? 0N/A // We'll decide whether to increase or decrease the tenuring 0N/A // threshold based partly on the newly computed survivor size 0N/A // (if we hit the maximum limit allowed, we'll always choose to 0N/A // decrement the threshold). 0N/A // Keep running averages on how much survived 0N/A // We use the tenuring threshold to equalize the cost of major 0N/A // and minor collections. 0N/A // ThresholdTolerance is used to indicate how sensitive the 0N/A // tenuring threshold is to differences in cost betweent the 0N/A // collection types. 0N/A // Get the times of interest. This involves a little work, so 0N/A // we cache the values here. 0N/A // Minor times are getting too long; lower the threshold so 0N/A // less survives and more is promoted. 0N/A // Major times are too long, so we want less promotion. 0N/A // Survivor space overflow occurred, so promoted and survived are 0N/A // not accurate. We'll make our best guess by combining survived 0N/A // and promoted and count them as survivors. 0N/A // We'll lower the tenuring threshold to see if we can correct 0N/A // things. Also, set the survivor size conservatively. We're 0N/A // trying to avoid many overflows from occurring if defnew size 0N/A // is just too small. 0N/A // The padded average also maintains a deviation from the average; 0N/A // we use this to see how good of an estimate we have of what survived. 0N/A // We're trying to pad the survivor size as little as possible without 0N/A // overflowing the survivor spaces. 0N/A // Target size is bigger than we can handle. Let's also reduce 0N/A // the tenuring threshold. 0N/A // Finally, increment or decrement the tenuring threshold, as decided above. 0N/A // We test for decrementing first, as we might have hit the target size 0N/A // We keep a running average of the amount promoted which is used 0N/A // to decide when we should collect the old generation (when 0N/A // the amount of old gen free space is less than what we expect to 0N/A // A little more detail if Verbose is on 0N/A " avg_deviation: %f",
0N/A " avg_promoted_dev: %f",
0N/A " avg_pretenured_padded_avg: %f" 0N/A " tenuring_thresh: %d"