1879N/A * Copyright (c) 2005, 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 return "adaptive size par new generation";
0N/A "Should only be used with UseAdaptiveSizePolicy");
0N/A // Resize the generation if needed. If the generation resize 0N/A // reports false, do not attempt to resize the spaces. 0N/A // Then we lay out the spaces inside the generation 0N/A// This method assumes that from-space has live data and that 0N/A// any shrinkage of the young gen is limited by location of 0N/A // Include any space that is committed but not included in 0N/A // the survivor spaces. 0N/A "Survivor space beyond high end");
0N/A // Don't let the space shrink to 0 0N/A "Space is too small");
0N/A // The only space available for shrinking is in to-space if it 0N/A // is above from-space. 0N/A// Return the number of bytes available for resizing down the young 0N/A// generation. This is the minimum of 0N/A// bytes to the minimum young gen size 0N/A// bytes to the size currently being used + some small extra 0N/A // Allow shrinkage into the current eden but keep eden large enough 0N/A // to maintain the minimum young gen size 0N/A// Note that the the alignment used is the OS page size as 0N/A// opposed to an alignment associated with the virtual space 0N/A // There used to be this guarantee there. 0N/A // guarantee ((eden_size + 2*survivor_size) <= _max_gen_size, "incorrect input arguments"); 0N/A // Code below forces this requirement. In addition the desired eden 0N/A // size and disired survivor sizes are desired goals and may 0N/A // exceed the total generation size. 0N/A // Adjust new generation size 0N/A // Grow the generation 0N/A return false;
// Error if we fail to resize! 0N/A // Was there a shrink of the survivor space? 0N/A // We require eden and to space to be empty 0N/A // There's nothing to do if the new sizes are the same as the current 0N/A // Check whether from space is below to space 0N/A // "requested_eden_size" is a goal for the size of eden 0N/A // and may not be attainable. "eden_size" below is 0N/A // calculated based on the location of from-space and 0N/A // the goal for the size of eden. from-space is 0N/A // fixed in place because it contains live data. 0N/A // The calculation is done this way to avoid 32bit 0N/A // overflow (i.e., eden_start + requested_eden_size 0N/A // may too large for representation in 32bits). 0N/A // Only make eden larger than the requested size if 0N/A // the minimum size of the generation has to be maintained. 0N/A // This could be done in general but policy at a higher 0N/A // level is determining a requested size for eden and that 0N/A // should be honored unless there is a fundamental reason. 0N/A // To may resize into from space as long as it is clear of live data. 0N/A // From space must remain page aligned, though, so we need to do some 0N/A // extra calculations. 0N/A // First calculate an optimal to-space 0N/A // Does the optimal to-space overlap from-space? 0N/A // Calculate the minimum offset possible for from_end 0N/A // Should we be in this method if from_space is empty? Why not the set_space method? FIX ME! 0N/A // Now update to_start with the new from_end 0N/A // If shrinking, move to-space down to abut the end of from-space 0N/A // so that shrinking will move to-space down. If not shrinking 0N/A // to-space is moving up to allow for growth on the next expansion. 0N/A // else leave to_end pointing to the high end of the virtual space. 0N/A // Calculate the to-space boundaries based on 0N/A // the start of from-space. 0N/A // Calculate the ideal eden boundaries. 0N/A // eden_end is already at the bottom of the generation 0N/A "Eden is not starting at the low end of the virtual space");
0N/A // Does eden intrude into to-space? to-space 0N/A // gets priority but eden is not allowed to shrink 0N/A // Don't let eden shrink down to 0 or less. 0N/A // Use all the space available. 0N/A "Eden size is too large");
0N/A // Move to-space down to eden. 0N/A // eden_end may have moved so again make sure 0N/A // the to-space and eden don't overlap. 0N/A "from start moved to the right");
0N/A "from end moved into live data");
0N/A // Let's make sure the call to initialize doesn't reset "top"! 0N/A // For PrintAdaptiveSizePolicy block below 263N/A // If not clearing the spaces, do some checking to verify that 263N/A // the spaces are already mangled. 263N/A // Must check mangling before the spaces are reshaped. Otherwise, 263N/A // the bottom or end of one space may have moved into another 263N/A // a failure of the check may not correctly indicate which space 263N/A // is not properly mangled. 0N/A // The call to initialize NULL's the next compaction space 0N/A "not a CMS generational heap");
0N/A "Wrong type of size policy");
0N/A // Keep running averages on how much survived 0N/A "Wrong kind of counters");
0N/A// Changes from PSYoungGen version 0N/A// value of "alignment" 0N/A // Currently, our eden size cannot shrink to zero 0N/A // Relationship of spaces to each other 0N/A // Check whether from space is below to space 0N/A // More checks that the virtual space is consistent with the spaces